Exit immediately if mock fails
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 11 Sep 2008 12:03:09 +0000 (08:03 -0400)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 11 Sep 2008 12:03:09 +0000 (08:03 -0400)
smock/smock.sh

index 41b7888..72b5e17 100755 (executable)
@@ -55,9 +55,14 @@ do
 
     mock -r $DIST-$ARCH --resultdir $LOCALREPO/scratch $SRPM
 
+    if [ $? != 0 ]; then
+       echo "Build failed, leaving logs in $LOCALREPO/scratch"
+       exit $?
+    fi
     mv $LOCALREPO/scratch/*.src.rpm $LOCALREPO/$DIST/src/SRPMS
     mv $LOCALREPO/scratch/*.rpm $LOCALREPO/$DIST/$ARCH/RPMS
     mv $LOCALREPO/scratch/*.log $LOCALREPO/$DIST/$ARCH/logs/$SRPM/
 done
 
 createrepos
+