bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dealing with verbose programs


From: Jim Meyering
Subject: Re: dealing with verbose programs
Date: Wed, 05 Sep 2007 07:50:33 +0200

Bruno Haible <address@hidden> wrote:
> Karl Berry wrote:
>> A wild thought: what if gnulib-tool saved its output during a run, and
>> then presented a *diff* of the new output and the old output?  I at
>> least would find that considerably more readable.
>>
>> (Along with a mention of the file where the full output can be found, of
>> course.)
>
> I'd love to have the same feature for "configure" and "make" runs.
> It could be a general-purpose utility, taking a command line as argument,
> like 'time' and 'nice' are.

Ha!  I wrote the following a few weeks ago, thinking some day
I'd write something more involved.  I'm not very happy with it,
because, at least with coreutils, it runs for too long without
giving any progress indicator.

If you only run make with -j1, then you can run make that way, too.
But with parallel builds, there's too much nondeterminism
and hence noise in the resulting diffs, even if you sort.

# Run specified command, recording its output and comparing (when done)
# with previous output.
# FIXME: add a progress bar, and allow options to specify:
#   - output file, if not stdout
#   - expected size of output in bytes
#   - expected length of output in lines
#   - expected run time
# and to record them (actual/expected) in a DB
monitor()
{
  sort=no
  case "$1" in --sort) sort=yes; shift;; esac

  case $# in
    2) local log=$1 cmd=$2;;
    *) echo "Usage: $FUNCNAME LOGFILE CMD" 1>&2; return 1;;
  esac
  echo "running $cmd..."
  eval "$cmd" > $log.new 2>&1
  test -f $log && {
    test $sort = yes \
      && sort $log | diff -u - <(sort $log.new) \
      || diff -u $log $log.new
  }
  command mv -f $log.new $log
}

bs()
{
  monitor        .m-bs './bootstrap --gnulib-srcdir=/gnulib'
  monitor        .m-conf ./configure
  monitor --sort .m-make make
  monitor        .m-make-check make check
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]