summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-09-26 13:42:44 +0200
committerHolger Levsen <holger@layer-acht.org>2015-09-26 13:42:44 +0200
commita590245c49172351bbfbbf0cb4bf124042a4d315 (patch)
tree037160a35dd5dffacbcf6bdb5c141bd0535c56b3
parentb2c6a97839ddc6ac74ea7e7fbe46e99f5149e4ef (diff)
downloadjenkins.debian.net-a590245c49172351bbfbbf0cb4bf124042a4d315.tar.xz
reproducible: simplify WHERE condition in sql statement - i dont get why it only works like this. the rest is harmless noise, removing debug code
-rwxr-xr-xbin/reproducible_build.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index fe27adef..cd322b37 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -388,20 +388,17 @@ choose_package() {
fi
rm -f $BAD_BUILDS
# mark build attempt, first test if none else marked a build attempt recently
- set -x
echo "ok, let's check if $SRCPACKAGE is building anywhere yet…"
RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT date_build_started FROM schedule WHERE package_id='$SRCPKGID'")
if [ -z "$RESULT" ] ; then
echo "ok, $SRCPACKAGE is not building anywhere…"
# try to update the schedule with our build attempt, then check no else did it, if so, abort
- sqlite3 -init $INIT ${PACKAGES_DB} "UPDATE schedule SET date_build_started='$DATE', builder='$BUILDER' WHERE package_id='$SRCPKGID' AND date_build_started='' AND (builder='' OR builder='TBD')"
- sleep 2
- local UPDATERESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT date_build_started FROM schedule WHERE package_id='$SRCPKGID' AND date_build_started='$DATE' AND builder='$BUILDER'")
- if [ -z "$UPDATERESULT" ] ; then
+ sqlite3 -init $INIT ${PACKAGES_DB} "UPDATE schedule SET date_build_started='$DATE', builder='$BUILDER' WHERE package_id='$SRCPKGID' AND date_build_started=''"
+ RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT date_build_started FROM schedule WHERE package_id='$SRCPKGID' AND date_build_started='$DATE' AND builder='$BUILDER'")
+ if [ -z "$RESULT" ] ; then
echo "hm, seems $SRCPACKAGE is building somewhere… failed to update the schedule table with our build ($SRCPKGID, $DATE, $BUILDER)."
handle_race_condition
fi
- set +x
else
echo "hm, seems $SRCPACKAGE is building somewhere… schedule table now listed it as building somewhere else."
handle_race_condition