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

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

 



Yes, I was using the $? return code.  Your suggestion works perfectly.

Thanks.  :)

On Wed, 10 Jan 2007, Luciano Miguel Ferreira Rocha wrote:

> Date: Wed, 10 Jan 2007 00:28:56 +0000
> From: Luciano Miguel Ferreira Rocha <strange@xxxxxxxxxxxxx>
> Reply-To: RPM Package Manager <rpm-list@xxxxxxxxxx>
> To: rpm-list@xxxxxxxxxx
> Subject: 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
> 
> 

-- 
Thanks,

Mark Sincerbox
Adax, Inc.
1-510-548-7047 x129

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux