pipefail doesn't work on NetBSD or FreeBSD

Gary E. Miller gem at rellim.com
Sat Oct 13 20:29:58 UTC 2018

Yo Hal!

On Sat, 13 Oct 2018 12:47:47 -0700
Hal Murray <hmurray at megapathdsl.net> wrote:

> >   ./waf configure --out=$DIR $2 2>&1 | tee    $DIR/test.log
> > The scripts run something (./waf configure in this case), and put
> > the output into a pipe to log it.  
> > Then next, there is a need to see if any part of the pipeling
> > failed.  But / bin/sh on *BSD only reports if the last part of the
> > pipeline failed.  tee rarely fails.  
> > "set -o pipefail" is supposed to return fail to $? if any part of
> > the pipeline failed.  
> > Any ideas how to do that?   
> Can we do what we need with ()s?

I have no idea.  I have not used anything but bash for decades.  But
it looks promising.  If you can test then you or I can change the code.

> That doesn't test the tee step, but the old bash code didn't do that
> either.


> PS: The bash version didn't work on NetBSD or FreeBSD either.

Yup.  That is why I felt OK to change it.  I was not worried about
breaking something already broken.

Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20181013/b611deb4/attachment.bin>

More information about the devel mailing list