--- Greg Allen <GAllen@xxxxxxxxxxxx> wrote: > I am doing the following in the %install section of > my spec file: > > source <script> > func <x> <y> <z> > > The shell function "func" is contained in <script> > and runs fine outside of > the rpmbuild call. When rpmbuild runs, however, I > get this: > > + read -a line > + echo SunOS > + egrep -qs '^Linux$|^Linux,|,Linux,|,Linux$' > + '[' 1 -ne 0 ']' > + return 1111 > error: Bad exit status from /var/tmp/rpm-tmp.5856 > (%install) > > Here's the snippet of code from "func": > > cat $file | egrep -v '^#' | \ > while read -a line; do > echo ${line[$platform_idx]} | egrep > $egrep_flags > "^$platform$|^$platform,|,$platform,|,$platform$" > if [ $? -eq 0 ]; then > # Do some stuff here. > fi > done > # Check if file processing succeeded. > if [ $? -ne 0 ]; then > return 1111 > fi > > For some reason, when run inside rpmbuild, the > failure of the egrep call is causing the > while loop to be exited! I have no idea why. > > I have also run the rpmbuild generated script > (/var/tmp/rpm-tmp.5856) standalone, and > it runs just fine. > > Can anyone tell me what is wrong? As long as I remember rpm's shell scriplets run with '-e' flag, i.e, script will be aborted after FIRSTcommand with non-zero exit status. You can try to run this script standalone but with -e and see what's happened. Valery __________________________________ Do you Yahoo!? Vote for the stars of Yahoo!'s next ad campaign! http://advision.webevents.yahoo.com/yahoo/votelifeengine/ _______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/rpm-list