[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: grep in spec file causes rpmbuild to abort with bad exit status



On Tue, Jan 09, 2007 at 04:14:23PM -0800, marks wrote:
> Hi,
> 
> I'm using grep in the install section of my spec file to determine
> if another file does or does not contain a piece of information.
> rpmbuild is aborting with a "bad exit status" message when grep 
> does not find the item of interest.

How are you doing that check? Using "$?"?

If you use it directly:
if grep -q bla file; then
 ....

rpmbuild doesn't exit.

If you want to ignore the exit code of a command, then add ||: (ie. or true).
Note that will change $? to true.
 
> Is there a way to turn off rpmbuild's abort of the entire build
> temporarily while I do the grep?

set +e
grep
set -e

-- 
lfr
0/0

Attachment: pgpoZJK5J97Ce.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]