more set -e fixes
authorLudwig Nussel <ludwig.nussel@suse.de>
Thu, 10 Dec 2009 16:28:41 +0000 (17:28 +0100)
committerLudwig Nussel <ludwig.nussel@suse.de>
Thu, 17 Dec 2009 13:58:34 +0000 (14:58 +0100)
build

diff --git a/build b/build
index e591a23..a05f96d 100755 (executable)
--- a/build
+++ b/build
@@ -1383,8 +1383,7 @@ for SPECFILE in "${SPECFILES[@]}" ; do
        test $BUILD_USER = abuild && cp -p $BUILD_ROOT/root/.rpmrc $BUILD_ROOT/home/abuild/.rpmrc
        # case arm, extract changetarget
        # this is restricted to arm to make sure it doesn't interfere with x86
-       buildarchtest=$( echo $BUILD_ARCH | grep -i arm )
-       if [ x"$buildarchtest" != x"" ]; then
+       if [ "$BUILD_ARCH" != "${BUILD_ARCH#arm}" ]; then
            echo "changing targetarch"
            CHANGETARGET=$(getchangetarget --dist "$BUILD_DIST" --configdir "$BUILD_DIR/configs" --archpath "$BUILD_ARCH" )
            echo "NEW TARGET: $CHANGETARGET"
@@ -1566,8 +1565,8 @@ for SPECFILE in "${SPECFILES[@]}" ; do
     test -d "$SRCDIR" && cd "$SRCDIR"
 done
 
-RPMS=`find $BUILD_ROOT/$TOPDIR/RPMS -type f -name "*.rpm" 2>/dev/null`
-DEBS=`find $BUILD_ROOT/$TOPDIR/DEBS -type f -name "*.deb" 2>/dev/null`
+RPMS=`find $BUILD_ROOT/$TOPDIR/RPMS -type f -name "*.rpm" 2>/dev/null || true`
+DEBS=`find $BUILD_ROOT/$TOPDIR/DEBS -type f -name "*.deb" 2>/dev/null || true`
 
 if test -n "$RPMS" -a -n "$BUILD_USER_ABUILD_USED" ; then
     echo "... checking for files with abuild user/group"
@@ -1585,7 +1584,6 @@ if test -n "$RPMS" -a -n "$BUILD_USER_ABUILD_USED" ; then
 fi
 
 if test -n "$RPMS" -a -d "$BUILD_ROOT/usr/lib/build/checks" ; then
-    mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
     export PNAME=""
     export DO_RPM_REMOVE=true
     for SRPM in $BUILD_ROOT/$TOPDIR/SRPMS/*src.rpm ; do
@@ -1595,7 +1593,6 @@ if test -n "$RPMS" -a -d "$BUILD_ROOT/usr/lib/build/checks" ; then
        echo "... running `basename $CHECKSCRIPT`"
        $CHECKSCRIPT || cleanup_and_exit 1
     done
-    umount -n $BUILD_ROOT/proc 2> /dev/null
 fi
 
 if test -n "$RPMS" -a "$DO_CHECKS" != "false" -a -x "$BUILD_ROOT/opt/testing/bin/rpmlint" -a -d "$BUILD_ROOT/$TOPDIR/RPMS" ; then
@@ -1641,9 +1638,9 @@ fi
 if test -n "$RPMS" -a -d "$BUILD_ROOT/$TOPDIR/RPMS" -a -d "$BUILD_ROOT/.build.oldpackages" -a -x "$BUILD_ROOT/usr/lib/build/same-build-result.sh" ; then
     echo "... comparing built packages with the former built"
     # exit with 2, if packages built successfull, but have no changes to former built packages.
-    mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
-    chroot $BUILD_ROOT /usr/lib/build/same-build-result.sh /.build.oldpackages "$TOPDIR/RPMS" "$TOPDIR/SRPMS" && cleanup_and_exit 2
-    umount -n $BUILD_ROOT/proc 2> /dev/null
+    if chroot $BUILD_ROOT /usr/lib/build/same-build-result.sh /.build.oldpackages "$TOPDIR/RPMS" "$TOPDIR/SRPMS"; then
+       cleanup_and_exit 2
+    fi
 fi
 
 echo