From b7a303819727cd1dc33705ebdedc88eb79ae35cb Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 13 Mar 2015 17:55:23 +0100 Subject: reproducible: really fixup last two commits --- bin/reproducible_build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'bin/reproducible_build.sh') diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index a2a12ac9..31cf7f7a 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -184,14 +184,22 @@ else update_db_and_html exit 0 else - set -e VERSION=$(grep "^Version: " ${SRCPACKAGE}_*.dsc| head -1 | egrep -v '(GnuPG v|GnuPG/MacGPG2)' | cut -d " " -f2-) # EPOCH_FREE_VERSION was too long EVERSION=$(echo $VERSION | cut -d ":" -f2) # preserve RBUILDLOG as TMPLOG, then cleanup userContent from previous builds, # and then access RBUILDLOG with it's correct name (=eversion) TMPLOG=$(mktemp) - mv ${RBUILDLOG} ${TMPLOG} || { echo "Warning, package ${SRCPACKAGE} in ${SUITE} on ${ARCH} is probably already building elsewhere, exiting." ; exit 0 } + # catch race conditions due to several builders trying to build the same package + mv ${RBUILDLOG} ${TMPLOG} + RESULT=$? + if [ $RESULT -ne 0 ] ; then + echo "Warning, package ${SRCPACKAGE} in ${SUITE} on ${ARCH} is probably already building elsewhere, exiting." + echo "Warning, package ${SRCPACKAGE} in ${SUITE} on ${ARCH} is probably already building elsewhere, exiting. Please check $BUILD_URL" | mail -s "race condition found" qa-jenkins-scm@lists.alioth.debian.org + exit 0 + fi + set -e + cleanup_userContent RBUILDLOG=/var/lib/jenkins/userContent/rbuild/${SUITE}/${ARCH}/${SRCPACKAGE}_${EVERSION}.rbuild.log mv ${TMPLOG} ${RBUILDLOG} -- cgit v1.2.3-70-g09d2