This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: Concern about new g-b-s logging change - loss of error detection
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Max Bowsher <maxb at ukf dot net>
- Cc: cygwin-apps at cygwin dot com
- Date: Sun, 30 Oct 2005 12:51:28 -0500 (EST)
- Subject: Re: Concern about new g-b-s logging change - loss of error detection
- References: <05f001c5dca1$a2d1c8f0$5304a8c0@chimaera>
- Reply-to: cygwin-apps at cygwin dot com
On Sat, 29 Oct 2005, Max Bowsher wrote:
> Please forgive me if this has already been discussed - I've been
> time-limited to scanning subject lines only recently.
>
> Bourne shells consider only the exit status of the last command in a
> pipeline when determining $? - this means that the addition of lots of
> "| tee somefile" will cause errors occurring during the commands being
> logged to be ignored.
>
> This seems to me to be a more severe problem than not keeping the logs
> in the first place - as a failing "make" could result in the packaging
> of a partially built package.
Max,
Thanks for bringing this up. This hasn't been discussed, and I admit I
missed this aspect of the problem when reviewing the patch. I did have a
fleeting thought of changing the "tee"s to redirections, but didn't
realize the importance of this. I just verified that even with "set -e"
in effect, bash will not terminate if an interior pipe command fails.
I can think of two ways to tackle this: use redirection (with the loss of
immediate console output), or use $PIPESTATUS (which is a bashism, and is
fragile, unless we use ${PIPESTATUS[$((${#PIPESTATUS[@]}-1))]}). Any
other suggestions?
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA