Build doesn't fail if od not installed

Rob Landley rob at landley.net
Fri Sep 17 18:35:55 UTC 2010


On Thursday 16 September 2010 16:31:32 Denys Vlasenko wrote:
> applets/usage_compressed:
>
> # Some people were bitten by their system lacking a (proper) od
> od -v -t x1 </dev/null >/dev/null
> if test $? != 0; then
> 	echo 'od tool is not installed or cannot accept "-v -t x1" options'
> 	exit 1
> fi

The attempt to use od will already throw an error, either from the shell not 
finding it or od complaining about command line arguments it doesn't like.

All you need is an || exit 1 on the command line so the build _stops_ and the 
error message doesn't get buried by other stuff.

I tend to do big stacks of:

thing &&
thing &&
thing &&
thing &&
thing || exit 1

Rob
-- 
GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.


More information about the busybox mailing list