-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
- dak process-unchecked -a $changes >> $report
- echo "--" >> $report
-
- 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
- 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
+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