Andrew Fyfe wrote:
Hi
Found a small bug. When running 'makepkg --log' makepkg doesn't stop if build() fails. Patch attached, see the header for an example.
Andrew
------------------------------------------------------------------------
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://www.archlinux.org/mailman/listinfo/pacman-dev
Sorry wrong patch attached, this one fixes. Without '-L' it fails but doesn't print the error message. Andrew ------------------------------------------------------------ revno: 3 committer: Andrew Fyfe <andrew@neptune-one.net> branch nick: bug_log_pipe timestamp: Sun 2007-03-25 16:39:45 +0100 message: * Fix bug where 'makepkg -L' doesn't stop on build failure. To test... PKGBUILD>> pkgname=test-package pkgver=1 pkgrel=1 arch=(i686) build() { false; } run makepkg -L build() will fail and makepkg carries on trying to create the package. === modified file 'scripts/makepkg' --- old/scripts/makepkg 2007-03-25 15:39:45 +0000 +++ new/scripts/makepkg 2007-03-25 15:57:34 +0000 @@ -883,6 +883,7 @@ echo $SHELLOPTS | grep errexit 2>&1 >/dev/null set_e=$? + ret=0 if [ "$LOGGING" = "1" ]; then BUILDLOG="${startdir}/${pkgname}-${pkgver}-${pkgrel}-${CARCH}.log" if [ -f "$BUILDLOG" ]; then @@ -910,9 +911,9 @@ else #use 'errexit' to bail on syntax error [ $set_e -eq 1 ] && set -e - build 2>&1 + build 2>&1 || ret=$? [ $set_e -eq 1 ] && set +e - if [ $? -gt 0 ]; then + if [ $ret -gt 0 ]; then error "Build Failed. Aborting..." removedeps exit 2