Re: %install section script problem...

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

 



>    + 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'd suspect the shell. I assume your script is made to be run with bash
(I believe using plain bourne shell you should write
while ...
do ..
...
done)

When your scriptlet is run by rpm, it might be run using /bin/sh instead
of bash (although on most linux systems this will be the same).


_______________________________________________
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