Date: Fri, 25 Jun 2010 15:30:56 +0200 From: Jilles Tjoelker <jilles@stack.nl> To: Patrick Mahan <mahan@mahan.org> Cc: freebsd-hackers@freebsd.org Subject: Re: Help with some makefile hackery Message-ID: <20100625133056.GA97679@stack.nl> In-Reply-To: <4C21A743.6040306@mahan.org> References: <4C21A743.6040306@mahan.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jun 22, 2010 at 11:18:43PM -0700, Patrick Mahan wrote:
> src-kern-tools:
> cd src; ./<machine>-kernel-toolchain.sh 2>&1 | tee <logfile>
The pipeline will return the status of 'tee' which is almost always 0.
The exit status of the build script is ignored.
A simple fix is store the status in a file and refer to that afterwards.
Another fix uses a separate file descriptor to pass through the status,
like
{ st=$(
{
{ ./kernel-toolchain.sh 2>&1 3>&- 4>&-; echo $? >&3; } | tee logfile >&4
} 3>&1)
} 4>&1
but this is fairly complicated.
The issue can be sidestepped entirely by sending the output to a file
only; a developer can use tail -f to follow the build if necessary.
--
Jilles Tjoelker
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100625133056.GA97679>
