bug-gnulib
[Top][All Lists]
Advanced

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

sed, SIGPIPE, cmp -s [Re: [PATCH 3/4] gnulib-tool: abort loops early whe


From: Jim Meyering
Subject: sed, SIGPIPE, cmp -s [Re: [PATCH 3/4] gnulib-tool: abort loops early where possible.
Date: Mon, 29 Dec 2008 20:40:13 +0100

Ralf Wildenhues <address@hidden> wrote:
> * gnulib-tool (func_modules_add_dummy, func_emit_lib_Makefile_am)
> (func_emit_tests_Makefile_am, func_import): Abort loops early if
> we already know the answer.

Hi Ralf,

Not that I've reviewed it in detail, but this looks ok.
Also, it induces no change in coreutils build products
(both with this new version of 3/4 and the previous).

However, I did notice this (independent of your patches),
when comparing the output of two bootstrap runs:

  -sed: couldn't write 36 items to stdout: Broken pipe
  +sed: couldn't write 30 items to stdout: Broken pipe
   ./bootstrap: Copying ._bootmp/gnulib-tests/Makefile.am to 
gnulib-tests/gnulib.mk...
  -sed: couldn't write 60 items to stdout: Broken pipe
  +sed: couldn't write 56 items to stdout: Broken pipe

I see that it's technically harmless and comes from here:

        sed "$remove_intl" $1/$dir/$file | cmp -s - $dir/$gnulib_mk || {
              echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." &&

because using GNU cmp's -s (--silent/ exit-status-only) option
makes it refrain from reading all input, so sed's write evokes SIGPIPE.

I may take this as encouragement not to use -s,
and just redirect to /dev/null instead.




reply via email to

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