X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcron.unchecked;h=0006f80e3a4c5ddaf0730e962e50ae996bdafbd2;hb=87bf163d12ec8328d87e1b2a2ca2239221a73bd6;hp=41b664016126c642d12d7bb159d038e9f99f5516;hpb=006cbdd7669733c100b5ff59352c15591b11ff0f;p=dak.git diff --git a/config/debian/cron.unchecked b/config/debian/cron.unchecked index 41b66401..0006f80e 100755 --- a/config/debian/cron.unchecked +++ b/config/debian/cron.unchecked @@ -1,10 +1,13 @@ -#! /bin/sh +#! /bin/bash set -e set -u export SCRIPTVARS=/srv/ftp.debian.org/dak/config/debian/vars . $SCRIPTVARS +# common functions are "outsourced" +. "${configdir}/common" + LOCKDAILY="" LOCKFILE="$lockdir/unchecked.lock" NOTICE="$lockdir/daily.lock" @@ -16,10 +19,29 @@ STAMP=$(date "+%Y%m%d%H%M") cleanup() { rm -f "$LOCKFILE" if [ ! -z "$LOCKDAILY" ]; then - rm -f "$NOTICE" + rm -f "$NOTICE" fi } +# in case there is anything NEW processed, move it over into the accepted queue +cd $newstage +for file in $(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs); do + sed '1,/Files:/d' "${file}" | sed '/BEGIN PGP SIGNATURE/,$d' \ + | while read notused1 notused2 notused3 notused4 NAME; do + if [ -z "${NAME}" ]; then + # Sometimes there is a newline after the Files:, ignore it + continue + fi + if [ -f "${NAME}" ]; then + mv --target-directory="${accepted}" "${NAME}" + else + log_error "Error, couldn't find file ${NAME} to move to ${accepted}" + exit 2 + fi + done + mv --target-directory="${accepted}" "${file}" "${file%%.changes}.dak" +done + # only run one cron.unchecked if lockfile -r3 $LOCKFILE; then trap cleanup 0 @@ -30,50 +52,37 @@ if lockfile -r3 $LOCKFILE; then timestamp=$(date "+%Y-%m-%d %H:%M") if [ ! -z "$changes" ]; then - echo "$timestamp": "$changes" >> $report - dak process-unchecked -a $changes >> $report - echo "--" >> $report - - # sync with debbugs - rsync -aq -e "ssh -o Batchmode=yes -o ConnectTimeout=30 -o SetupTimeout=30" --remove-source-files $queuedir/bts_version_track/ bugs-sync:/org/bugs.debian.org/versions/queue/ftp-master/ 2>/dev/null && touch $lockdir/synced_bts_version || true - - NOW=$(date +%s) - TSTAMP=$(stat -c %Y $lockdir/synced_bts_version) - DIFF=$(( NOW - TSTAMP )) - if [ $DIFF -ge 259200 ]; then - echo "Kids, you tried your best and you failed miserably. The lesson is, never try. (Homer Simpson)" - fi + echo "$timestamp": "$changes" >> $report + dak process-unchecked -a -d "$unchecked" >> $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 $configdir - apt-ftparchive -qq -o APT::FTPArchive::Contents=off generate apt.conf.buildd + # sync with debbugs + rsync -aq -e "ssh -o Batchmode=yes -o ConnectTimeout=30 -o SetupTimeout=30" --remove-source-files $queuedir/bts_version_track/ bugs-sync:/org/bugs.debian.org/versions/queue/ftp-master/ 2>/dev/null && touch $lockdir/synced_bts_version || true - cd ${incoming} - rm -f buildd/Release* - apt-ftparchive -qq -o APT::FTPArchive::Release::Origin="Debian" -o APT::FTPArchive::Release::Label="Debian" -o APT::FTPArchive::Release::Description="buildd incoming" -o APT::FTPArchive::Release::Architectures="${archs}" release buildd > Release - gpg --secret-keyring /srv/ftp.debian.org/s3kr1t/dot-gnupg/secring.gpg --keyring /srv/ftp.debian.org/s3kr1t/dot-gnupg/pubring.gpg --no-options --batch --no-tty --armour --default-key 6070D3A1 --detach-sign -o Release.gpg Release - mv Release* buildd/. + NOW=$(date +%s) + TSTAMP=$(stat -c %Y $lockdir/synced_bts_version) + DIFF=$(( NOW - TSTAMP )) + if [ $DIFF -ge 259200 ]; then + echo "Kids, you tried your best and you failed miserably. The lesson is, never try. (Homer Simpson)" + fi - cd ${incoming} - mkdir -p tree/${STAMP} - cp -al ${incoming}/buildd/. tree/${STAMP}/ - ln -sfT tree/${STAMP} ${incoming}/builddweb - find ./tree -mindepth 1 -maxdepth 1 -not -name "${STAMP}" -type d -print0 | xargs --no-run-if-empty -0 rm -rf + 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 + make_buildd_dir - . $configdir/cron.buildd - fi + . $configdir/cron.buildd + fi else - echo "$timestamp": Nothing to do >> $report + echo "$timestamp": Nothing to do >> $report fi fi