diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-03-13 17:34:33 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-03-13 17:34:33 +0100 |
commit | 88c565468c0c8bd7ef2cfefa66b88451d55fbb1a (patch) | |
tree | 981ff20fd80a1accff92a7ffbf8e4d1c4930a38f /bin | |
parent | bc38e420f400fd43f43d356beaa4e868d0c98dfa (diff) | |
download | jenkins.debian.net-88c565468c0c8bd7ef2cfefa66b88451d55fbb1a.tar.xz |
reproducible: handle race conditions gracefully
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_build.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 8750f789..f8efd220 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -148,6 +148,7 @@ else SRCPKGID=$(echo $RESULT|cut -d "|" -f2) SRCPACKAGE=$(echo $RESULT|cut -d "|" -f3) SCHEDULED_DATE=$(echo $RESULT|cut -d "|" -f4) + create_results_dirs echo "=============================================================================" echo "Trying to reproducibly build ${SRCPACKAGE} in ${SUITE} on ${ARCH} now." echo "=============================================================================" @@ -157,7 +158,6 @@ else DURATION=0 # mark build attempt sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO schedule (package_id, date_scheduled, date_build_started) VALUES ('$SRCPKGID', '$SCHEDULED_DATE', '$DATE');" - create_results_dirs RBUILDLOG=/var/lib/jenkins/userContent/rbuild/${SUITE}/${ARCH}/${SRCPACKAGE}_None.rbuild.log echo "Starting to build ${SRCPACKAGE}/${SUITE} on $DATE" | tee ${RBUILDLOG} @@ -191,7 +191,7 @@ else # 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} + mv ${RBUILDLOG} ${TMPLOG} || { 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." | mail -s "race condition found" qa-jenkins-scm@lists.alioth.debian.org ; exit 0 } cleanup_userContent RBUILDLOG=/var/lib/jenkins/userContent/rbuild/${SUITE}/${ARCH}/${SRCPACKAGE}_${EVERSION}.rbuild.log mv ${TMPLOG} ${RBUILDLOG} |