From Bugzilla Helper: User-Agent: Mozilla/4.61 [en] (X11; I; Linux 2.2.12-20 i686) In an rpm spec, if you have %build (cd foo;make foo) and the make fails, then rpm goes ahead and tries to finish making the rpms. If you do this instead %build cd foo;make foo then a failure in the make causes the whole rpm --bb to stop. The presence of parentheses should not change the behavior. I've seen this in RPM 3.0.5-9.6x The correct behavior is that when the make fails, the rpm should not be built. Reproducible: Always Steps to Reproduce: Make an rpm out of a makefile that fails. (I built a foo.tar.gz that contained a file foo/foo.c which doesn't compile) and then have the %build step be (cd foo; make foo) the make fails, but the rpm system will continue by running the %install script. This is the bad behavior in which the problem isn't noticed until the install script runs. $ rpm -bb foo.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.89140 + umask 022 + cd /u0/bradley/redhat/BUILD + cd /u0/bradley/redhat/BUILD + rm -rf foo + /bin/mkdir -p foo + cd foo + /bin/gzip -dc /u0/bradley/redhat/SOURCES/foo.tar.gz + tar -xvvf - drwxrwxr-x bradley/users 0 2001-02-07 10:01:47 foo/ -rw-rw-r-- bradley/users 17 2001-02-07 10:01:47 foo/foo.c -rw-rw-r-- bradley/users 0 2001-02-07 10:01:34 foo/foo.c.~1~ + STATUS=0 + [ 0 -ne 0 ] ++ /usr/bin/id -u + [ 20202 = 0 ] ++ /usr/bin/id -u + [ 20202 = 0 ] + /bin/chmod -Rf a+rX,g-w,o-w . + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.89140 + umask 022 + cd /u0/bradley/redhat/BUILD + cd foo + cd foo + make foo gcc -g -O2 foo.c -o foo foo.c:1: parse error before `)' make: *** [foo] Error 1 + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.89140 + umask 022 + cd /u0/bradley/redhat/BUILD + cd foo + rm -rf /u0/bradley/redhat/buildroot + mkdir --parents /u0/bradley/redhat/buildroot/usr/local + cp foo /u0/bradley/redhat/buildroot/usr/local/foo cp: foo: omitting directory Bad exit status from /var/tmp/rpm-tmp.89140 (%install) This is the good behavior $ rpm -bb foo.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.3115 + umask 022 + cd /u0/bradley/redhat/BUILD + cd /u0/bradley/redhat/BUILD + rm -rf foo + /bin/mkdir -p foo + cd foo + /bin/gzip -dc /u0/bradley/redhat/SOURCES/foo.tar.gz + tar -xvvf - drwxrwxr-x bradley/users 0 2001-02-07 10:01:47 foo/ -rw-rw-r-- bradley/users 17 2001-02-07 10:01:47 foo/foo.c -rw-rw-r-- bradley/users 0 2001-02-07 10:01:34 foo/foo.c.~1~ + STATUS=0 + [ 0 -ne 0 ] ++ /usr/bin/id -u + [ 20202 = 0 ] ++ /usr/bin/id -u + [ 20202 = 0 ] + /bin/chmod -Rf a+rX,g-w,o-w . + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.3115 + umask 022 + cd /u0/bradley/redhat/BUILD + cd foo + cd foo + make foo gcc -g -O2 foo.c -o foo foo.c:1: parse error before `)' make: *** [foo] Error 1 Bad exit status from /var/tmp/rpm-tmp.3115 (%build)
Created attachment 9280 [details] Here is a source rpm that improperly continues after the build.
Created attachment 9281 [details] And here is the rpm with the spec fixed. But rpm -bb should behave the same for both
This is a packaging problem, not an rpm problem, and has to do with passing a -e option from parent shell to sub-shell. Try (cd foo && exit 1 make foo && exit 1 ) and other variant shell scripts to fix.