* fix oldpackage compare support for running without XEN.
authorAdrian Schröter <adrian@suse.de>
Sun, 8 Feb 2009 11:01:43 +0000 (11:01 +0000)
committerAdrian Schröter <adrian@suse.de>
Sun, 8 Feb 2009 11:01:43 +0000 (11:01 +0000)
Greetings from FOSDEM :)

build

diff --git a/build b/build
index ead57cd..cd5882c 100755 (executable)
--- a/build
+++ b/build
@@ -946,10 +946,9 @@ for SPECFILE in "${SPECFILES[@]}" ; do
                # remove setuid bit if files belong to user to make e.g. mount work
                find $BUILD_ROOT/{bin,sbin,usr/bin,usr/sbin} -type f -uid $UID -perm +4000 -print0 | xargs -0 --no-run-if-empty chmod -s
            fi
-            if [ -d $OLD_PACKAGES ]; then
+            if [ -d "$OLD_PACKAGES" ]; then
                rm -rf $BUILD_ROOT/.build.oldpackages
                cp -a $OLD_PACKAGES $BUILD_ROOT/.build.oldpackages
-               OLD_PACKAGES=/.build.oldpackages
             fi
        fi
        # start up xen, rerun ourself
@@ -1093,6 +1092,9 @@ for SPECFILE in "${SPECFILES[@]}" ; do
        "$@" || cleanup_and_exit 1
        mount -n -tproc none $BUILD_ROOT/proc || true
        mount -n -tdevpts none $BUILD_ROOT/dev/pts
+        if [ -d "$OLD_PACKAGES" ]; then
+           [ -d "$BUILD_ROOT/.build.oldpackages" ] || cp -r $OLD_PACKAGES $BUILD_ROOT/.build.oldpackages
+        fi
     fi
 
     if test -z "$BUILD_DIST" -a -e "$BUILD_ROOT/.guessed_dist" ; then
@@ -1525,10 +1527,10 @@ if test -n "$RUNNING_IN_VM" -a -n "$VM_SWAP"; then
     $BUILD_DIR/extractbuild "$VM_SWAP" || cleanup_and_exit 1
 fi
 
-if test -n "$RPMS" -a -d "$BUILD_ROOT/$TOPDIR/RPMS" -a -d "$OLD_PACKAGES" -a -x "$BUILD_ROOT/usr/lib/build/same-build-result.sh" ; then
+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.
-    chroot $BUILD_ROOT /usr/lib/build/same-build-result.sh "$OLD_PACKAGES" "$TOPDIR/RPMS" "$TOPDIR/SRPMS" && cleanup_and_exit 2
+    chroot $BUILD_ROOT /usr/lib/build/same-build-result.sh /.build.oldpackages "$TOPDIR/RPMS" "$TOPDIR/SRPMS" && cleanup_and_exit 2
 fi
 
 echo "... build is finished"