From cc3f3adf7b8062005d9212b738c3235aba6c4b7e Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sun, 19 Oct 2014 12:25:21 +0200 Subject: reproducible: fix race condition when a package page was already updated after a build has started... --- bin/reproducible_build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 4a7fc84b..3d3d5f0a 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -25,8 +25,9 @@ cleanup_userContent() { unschedule_from_db() { # unmark build as properly finished sqlite3 -init $INIT ${PACKAGES_DB} "DELETE FROM sources_scheduled WHERE name = '$SRCPACKAGE';" - # update html page for package set +x + # (force) update html page for package (only really needed for long building packages where a note updates the page during build....) + touch -d $PREDATE /var/lib/jenkins/userContent/rb-pkg/${SRCPACKAGE}.html process_packages $SRCPACKAGE echo echo "Successfully updated the database and updated $JENKINS_URL/userContent/rb-pkg/$SRCPACKAGE.html" @@ -48,6 +49,7 @@ else echo "Trying to build ${SRCPACKAGE} reproducibly now." echo "=============================================================================" set -x + PREDATE=$(date -d "1 minute ago" +'%Y-%m-%d %H:%M') DATE=$(date +'%Y-%m-%d %H:%M') # mark build attempt sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO sources_scheduled VALUES ('$SRCPACKAGE','$SCHEDULED_DATE','$DATE');" -- cgit v1.2.3-54-g00ecf