Build doesn't fail if od not installed

walter harms wharms at bfs.de
Fri Sep 17 07:25:55 UTC 2010



Denys Vlasenko schrieb:
> On Thursday 16 September 2010 14:52, walter harms wrote:
>> Harald Becker schrieb:
>>>  Hi!
>>>> NTL the main problem here is that the missing "od" is detected but the script
>>>> is continuing only to fail otherwise.
>>> True. That's the topic, I'm not complaining about if od is required or
>>> not. Just that the build succeeded and didn't just abort at that point,
>>> with a possible command not found message from make/shell. I don't
>>> expect any error handling. Just abort and say failure ... and not
>>> success ... resulting in confusion, when busybox fails with a
>>> segmentation fault when just doing a xxx --help ... which let to hours
>>> of searching for what has gone wrong :-(
>>>
>> I just want to clear that there are two problems.
>>
>> 1. check that every think is there what is need to compile bb
>> 2. what to do if something is found missing
>>
>> my idea is to have a script like
>>
>> which --version >/dev/null || { echo "i need which" ; exit ; }
>> for CMD in od
>> do
>>  which $CMD || { echo "i need $CMD" ; exit ; }
>> done
>>
>> this can be executed manually and its done. I guess that is what denis had
>> in mind.
> 
> Not really, the fix looks like this:
> 
> 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
> 
> That is, I check od availability before I'm going to use it in 
> applets/usage_compressed script.
> 
> 
i idee was not intended to be part of the std. build process. the idea was only
to give devellopers a way to check requirements. Basicly we could more that to
documentaton but who read documentation these days ....

re,
 wh



More information about the busybox mailing list