]> git.decadent.org.uk Git - dak.git/commitdiff
cron.unchecked lockfile udpates
authorAnthony Towns <aj@azure.humbug.org.au>
Fri, 25 Nov 2005 05:58:18 +0000 (05:58 +0000)
committerAnthony Towns <aj@azure.humbug.org.au>
Fri, 25 Nov 2005 05:58:18 +0000 (05:58 +0000)
ChangeLog
cron.unchecked

index 56f50b4f3bc9e4145d5279ad1fa3bfc518d9cf6a..d8e85425394996f7b9059cab81181d4e2c421ae5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,14 @@
 2005-11-25  Anthony Towns  <aj@erisian.com.au>
 
+       * Finishing merge of changes from spohr, by various people still
+
        * jennifer: If changed-by parsing fails, set variables to "" so REJECT
        works
        * jennifer: Re-enable .deb ar format checking
        * katie.py: Convert to +bX binNMU special casing
        * rhona: Add some debug output when deleting binaries
        * cron.daily: Add emilie
+       * cron.unchecked: Add lock files
 
 2005-11-15  Anthony Towns  <aj@erisian.com.au>
 
index 6129c549bf6503d8052191c1864c88d04245fdda..a96ec091ecc3a03aa8284214d4e2130580816519 100644 (file)
@@ -4,29 +4,48 @@ set -e
 export SCRIPTVARS=/org/ftp.debian.org/katie/vars
 . $SCRIPTVARS
 
-cd $unchecked
-
-changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs)
-report=$queuedir/REPORT
-timestamp=$(date "+%Y-%m-%d %H:%M")
-
-if [ ! -z "$changes" ]; then
-  echo "$timestamp": "$changes"  >> $report
-  jennifer -a $changes >> $report
-  echo "--" >> $report
-else
-  echo "$timestamp": Nothing to do >> $report
-fi
+LOCKFILE="$lockdir/unchecked.lock"
+NOTICE="$lockdir/daily.lock"
 
-psql projectb -A -t -q -c "SELECT filename FROM accepted_autobuild WHERE suite = 5 AND filename ~ 'd(sc|eb)$'" > $dbdir/dists/unstable_accepted.list
-cd $overridedir
-denise &>/dev/null
-rm -f override.sid.all3 override.sid.all3.src
-for i in main contrib non-free main.debian-installer; do
-  cat override.sid.$i >> override.sid.all3
-  if [ "$i" != "main.debian-installer" ]; then
-    cat override.sid.$i.src >> override.sid.all3.src
+cleanup() {
+  rm -f "$LOCKFILE"
+  if [ ! -z "$LOCKDAILY" ]; then
+         rm -f "$NOTICE"
   fi
-done
-cd $masterdir
-apt-ftparchive -qq generate apt.conf.buildd &>/dev/null
+}
+
+# only run one cron.unchecked
+if lockfile -r3 $LOCKFILE; then
+       trap cleanup 0
+       cd $unchecked
+
+       changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs)
+       report=$queuedir/REPORT
+       timestamp=$(date "+%Y-%m-%d %H:%M")
+
+       if [ ! -z "$changes" ]; then
+               echo "$timestamp": "$changes"  >> $report
+               jennifer -a $changes >> $report
+               echo "--" >> $report
+
+               if lockfile -r3 $NOTICE; then
+                       LOCKDAILY="YES"
+                       psql projectb -A -t -q -c "SELECT filename FROM accepted_autobuild WHERE suite = 5 AND in_accepted = true AND filename ~ 'd(sc|eb)$'" > $dbdir/dists/unstable_accepted.list
+                       cd $overridedir
+                       denise &>/dev/null
+                       rm -f override.sid.all3 override.sid.all3.src
+                       for i in main contrib non-free main.debian-installer; do
+                               cat override.sid.$i >> override.sid.all3
+                               if [ "$i" != "main.debian-installer" ]; then
+                                       cat override.sid.$i.src >> override.sid.all3.src
+                               fi
+                       done
+                       cd $masterdir
+                       apt-ftparchive -qq generate apt.conf.buildd
+                       . $masterdir/cron.buildd
+               fi
+       else
+               echo "$timestamp": Nothing to do >> $report
+       fi
+fi
+