add support for build result compare script.
authorAdrian Schröter <adrian@suse.de>
Mon, 2 Feb 2009 16:45:17 +0000 (16:45 +0000)
committerAdrian Schröter <adrian@suse.de>
Mon, 2 Feb 2009 16:45:17 +0000 (16:45 +0000)
build

diff --git a/build b/build
index 5df97c0..6938766 100755 (executable)
--- a/build
+++ b/build
@@ -168,6 +168,9 @@ usage () {
 
 #
 #  cleanup_and_exit
+#  return values: 0 -> success, new packages built
+#                 1 -> error, build failed
+#                 2 -> successfull build, but no changes to former built packages
 #
 cleanup_and_exit () {
     trap EXIT
@@ -1446,6 +1449,15 @@ if test -n "$RPMS" -a -n "$CREATE_BASELIBS" -a -d "$BUILD_ROOT/$TOPDIR/RPMS" ; t
     fi
 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.
+    chroot $BUILD_ROOT /usr/lib/build/same-build-result.sh /.build.oldpackages "$TOPDIR/RPMS" "$TOPDIR/SRPMS" && cleanup_and_exit 2
+fi
+cleanup_and_exit 2
+
+# IMPLEMENT ME: place code for creating binary package deltas here
+
 if test -n "$RUNNING_IN_VM" -a -n "$VM_SWAP"; then
     echo "... saving built packages"
     swapoff "$VM_SWAP"