]> git.decadent.org.uk Git - dak.git/blobdiff - config/debian/cron.unchecked
Merge branch 'master' into dbtests
[dak.git] / config / debian / cron.unchecked
index e18f8635d62a50bbfe966d765867142b311c7ab5..c7d7dfdd2a402150bee9ffc1e470092987bf21c1 100755 (executable)
 set -e
 # make sure to only use defined variables
 set -u
+# ERR traps should be inherited from functions too. (And command
+# substitutions and subshells and whatnot, but for us the functions is
+# the important part here)
+set -E
 
 # import the general variable set.
-export SCRIPTVARS=/srv/ftp.debian.org/dak/config/debian/vars
+export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
 . $SCRIPTVARS
 
 LOCKDAILY=""
 LOCKFILE="$lockdir/unchecked.lock"
 LOCK_NEW="$lockdir/processnew.lock"
 NOTICE="$lockdir/daily.lock"
+LOCK_BUILDD="$lockdir/buildd.lock"
+
+# our name
+PROGRAM="unchecked"
 
 if [ -e $NOTICE ]; then
     exit 0;
@@ -52,7 +60,6 @@ cleanup() {
 function do_buildd () {
     if lockfile -r3 $NOTICE; then
         LOCKDAILY="YES"
-        psql projectb -A -t -q -c "SELECT filename FROM queue_build WHERE queue = 0 AND suite = 5 AND in_queue = true AND filename ~ 'd(sc|eb)$'" > $dbdir/dists/unstable_accepted.list
         cd $overridedir
         dak make-overrides &>/dev/null
         rm -f override.sid.all3 override.sid.all3.src
@@ -63,26 +70,40 @@ function do_buildd () {
             fi
         done
         make_buildd_dir
-
-        . $configdir/cron.buildd
+        wbtrigger
     fi
 }
 
+function do_dists () {
+    cd $configdir
+    dak generate-filelist
+    dak generate-packages-sources >/dev/null
+}
+
 ########################################################################
 # the actual unchecked functions follow                                #
 ########################################################################
 
-lockfile "$LOCK_NEW"
-acceptnew
-rm -f "$LOCK_NEW"
+# And use one locale, no matter what the caller has set
+export LANG=C
+export LC_ALL=C
+
+#lockfile -r3 "$LOCK_NEW"
+# acceptnew
+#rm -f "$LOCK_NEW"
 
 # only run one cron.unchecked
-lockfile -r3 $LOCKFILE || exit 0
+if ! lockfile -r8 $LOCKFILE; then
+    echo "aborting cron.unchecked because $LOCKFILE has already been locked"
+    exit 0
+fi
 trap cleanup 0
 
+do_newstage
 do_unchecked
 
 if [ ! -z "$changes" ]; then
     sync_debbugs
     do_buildd
+    do_dists
 fi