From f544f13b91fa2ebc2a5c91eb81098d93af639bfe Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Fri, 25 Nov 2005 05:58:18 +0000 Subject: [PATCH] cron.unchecked lockfile udpates --- ChangeLog | 3 +++ cron.unchecked | 67 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 46 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56f50b4f..d8e85425 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,14 @@ 2005-11-25 Anthony Towns + * 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 diff --git a/cron.unchecked b/cron.unchecked index 6129c549..a96ec091 100644 --- a/cron.unchecked +++ b/cron.unchecked @@ -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 + -- 2.39.5