# 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
"$@" || 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
$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"