]> err.no Git - dak/commitdiff
buildd
authorJoerg Jaspert <joerg@debian.org>
Wed, 4 Nov 2009 23:33:45 +0000 (00:33 +0100)
committerJoerg Jaspert <joerg@debian.org>
Wed, 4 Nov 2009 23:33:45 +0000 (00:33 +0100)
lock the buildd push, only one can go out at any time.

Signed-off-by: Joerg Jaspert <joerg@debian.org>
config/debian/common
config/debian/cron.buildd [deleted file]
config/debian/cron.unchecked
config/debian/dinstall.functions
config/debian/dinstall.variables

index 4a0d6cb997475e289117e1c2a09e28159cd436b1..38d95616fb90364db5c7ebe3cfb1fc4131bd17b9 100644 (file)
@@ -25,6 +25,20 @@ function debug () {
     fi
 }
 
+function wbtrigger() {
+    MODE=${1:-"often"}
+    SSHOPT="-o BatchMode=yes -o ConnectTimeout=30 -o SetupTimeout=240"
+    if lockfile -r 3 -l 3600 "${LOCK_BUILDD}"; then
+        if [ "x${MODE}x" = "xdailyx" ]; then
+            ssh -o ${SSHOPT} wbadm@buildd /org/wanna-build/trigger.daily || echo "W-B trigger.daily failed" | mail -s "W-B Daily trigger failed" ftpmaster@ftp-master.debian.org
+        elif [ "x${MODE}x" = "xoftenx" ]; then
+            ssh -q -q ${SSHOPT} wbadm@buildd /org/wanna-build/trigger.often
+        else
+            log_error "Unknown wb trigger mode called"
+        fi
+    fi
+}
+
 # used by cron.dinstall *and* cron.unchecked.
 function make_buildd_dir () {
     dak manage-build-queues -v buildd
diff --git a/config/debian/cron.buildd b/config/debian/cron.buildd
deleted file mode 100755 (executable)
index a5490e5..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#! /bin/sh
-#
-# Called from cron.unchecked to update wanna-build, each time it runs.
-#
-ssh -q -q -o BatchMode=yes -o ConnectTimeout=30 -o SetupTimeout=240 wbadm@buildd /org/wanna-build/trigger.often
-exit 0
index 371671287d21642bd8aefb5703464b4a5402be41..ee95878fa839047b15823953286e8093263ef312 100755 (executable)
@@ -33,6 +33,7 @@ LOCKDAILY=""
 LOCKFILE="$lockdir/unchecked.lock"
 LOCK_NEW="$lockdir/processnew.lock"
 NOTICE="$lockdir/daily.lock"
+LOCK_BUILDD="$lockdir/buildd.lock"
 
 # our name
 PROGRAM="unchecked"
@@ -69,8 +70,7 @@ function do_buildd () {
             fi
         done
         make_buildd_dir
-
-        . $configdir/cron.buildd
+        wbtrigger "often"
     fi
 }
 
index f1e49e4244cc844e75c6b4971fa150d4845a8ecd..77ef651da6d220395abef131dfdcc30b2e138ab8 100644 (file)
@@ -418,7 +418,7 @@ function mirror() {
 
 function wb() {
     log "Trigger daily wanna-build run"
-    ssh -o BatchMode=yes -o SetupTimeOut=90 -o ConnectTimeout=90 wbadm@buildd /org/wanna-build/trigger.daily || echo "W-B trigger.daily failed" | mail -s "W-B Daily trigger failed" ftpmaster@ftp-master.debian.org
+    wbtrigger "daily"
 }
 
 function expire() {
index be5b382a3e228fbf191fc930cf9bede585aa2657..353a3aebcc3bc2db74688dd89209acd1244be139 100644 (file)
@@ -38,3 +38,6 @@ LOCK_BRITNEY="$lockdir/britney.lock"
 # If this file exists we exit immediately after the currently running
 # function is done
 LOCK_STOP="$lockdir/archive.stop"
+
+# Lock buildd updates
+LOCK_BUILDD="$lockdir/buildd.lock"