makerpms: catch error of git archive correctly (echo resets $?)
authorMichael Adam <obnox@samba.org>
Wed, 17 Dec 2008 11:09:13 +0000 (12:09 +0100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 16 Jan 2009 09:49:51 +0000 (20:49 +1100)
Michael

packaging/RPM/makerpms.sh

index 2bd55b402ef84f39446bfa10918b13f94d39577d..0d3dfcc9b9679e63bf5ecc438c1664f9806ae170 100755 (executable)
@@ -30,8 +30,9 @@ RPMBUILD="rpmbuild"
 
 echo -n "Creating ctdb-${VERSION}.tar.gz ... "
 git archive --prefix=ctdb-${VERSION}/ HEAD | gzip -9 --rsyncable > ${SRCDIR}/ctdb-${VERSION}.tar.gz
+RC=$?
 echo "Done."
-if [ $? -ne 0 ]; then
+if [ $RC -ne 0 ]; then
         echo "Build failed!"
         exit 1
 fi