X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian-security%2Fcron.buildd;h=cd8a6851d47000fdc3bb42c8f7d3ea9c9f0659dd;hb=773f4286615587294d6e6acfb850df53a661bbc5;hp=0ea2b4fe836b3dcae0e607353f3911282488a323;hpb=6cfd1b05a05c82cac6cabb4af511093b37e903dd;p=dak.git diff --git a/config/debian-security/cron.buildd b/config/debian-security/cron.buildd index 0ea2b4fe..cd8a6851 100755 --- a/config/debian-security/cron.buildd +++ b/config/debian-security/cron.buildd @@ -3,64 +3,35 @@ # Executed after cron.unchecked set -e +set -o pipefail set -u export SCRIPTVARS=/srv/security-master.debian.org/dak/config/debian-security/vars . $SCRIPTVARS SSH_SOCKET=~/.ssh/buildd.debian.org.socket -DISTS=$(dak admin s list) +DISTS="oldstable stable stable-kfreebsd testing" if [ -e $ftpdir/Archive_Maintenance_In_Progress ]; then exit 0 fi -for dist in $DISTS; do - eval SOURCES_$dist=`stat -c "%Y" $base/buildd/$dist/Sources.gz` - eval PACKAGES_$dist=`stat -c "%Y" $base/buildd/$dist/Packages.gz` -done - -cd $configdir -apt-ftparchive -qq -o APT::FTPArchive::Contents=off generate apt.conf.buildd - -cd ${base}/buildd -for dist in $DISTS; do - rm -f $dist/Release* - darchs=$(dak admin s-a list-arch $dist | tr '\n' ' ') - codename=$(dak admin s show ${dist} | grep ^Codename | awk '{print $2}') - apt-ftparchive -qq -o APT::FTPArchive::Release::Codename="${codename}" -o APT::FTPArchive::Release::Origin="Debian" -o APT::FTPArchive::Release::Label="Debian" -o APT::FTPArchive::Release::Description="buildd $dist security" -o APT::FTPArchive::Release::Architectures="${darchs}" release $dist > Release - gpg --secret-keyring ${base}/s3kr1t/dot-gnupg/secring.gpg --keyring ${base}/s3kr1t/dot-gnupg/pubring.gpg --no-options --batch --no-tty --armour --default-key 55BE302B --detach-sign -o Release.gpg Release - mv Release* $dist/. -done - dists= - +now=$(date +%s) +check=$(( now - 3*60 )) for dist in $DISTS; do - eval NEW_SOURCES_$dist=`stat -c "%Y" $base/buildd/$dist/Sources.gz` - eval NEW_PACKAGES_$dist=`stat -c "%Y" $base/buildd/$dist/Packages.gz` - old=SOURCES_$dist - new=NEW_$old - if [ ${!new} -gt ${!old} ]; then - if [ -z "$dists" ]; then - dists="$dist" - else - dists="$dists $dist" - fi - continue - fi - old=PACKAGES_$dist - new=NEW_$old - if [ ${!new} -gt ${!old} ]; then - if [ -z "$dists" ]; then - dists="$dist" - else - dists="$dists $dist" - fi + smodtime=$(stat -c "%Y" $base/build-queues/dists/buildd-$dist/updates/*/source/Sources.gz | sort -n | tail -1) + pmodtime=$(stat -c "%Y" $base/build-queues/dists/buildd-$dist/updates/*/binary-*/Packages.gz | sort -n | tail -1) + + if [ ${smodtime} -gt ${check} ] || [ ${pmodtime} -gt ${check} ]; then + # Packages/Sources changed in the last minutes + dists="${dists} ${dist}" + else continue fi done -if [ ! -z "$dists" ]; then +if [ ! -z "${dists}" ]; then # setup ssh master process ssh wbadm@buildd -S $SSH_SOCKET -MN 2> /dev/null & SSH_PID=$! @@ -68,7 +39,28 @@ if [ ! -z "$dists" ]; then sleep 1 done trap 'kill -TERM $SSH_PID' 0 - for d in $dists; do - ssh wbadm@buildd -S $SSH_SOCKET trigger.security $d + for d in ${dists}; do + case ${d} in + oldoldstable) + send=squeeze + ;; + oldstable) + send=wheezy + ;; + stable) + send=jessie + ;; + stable-kfreebsd) + send=jessie-kfreebsd + ;; + testing) + send=stretch + ;; + *) + send=unknown + ;; + esac + + ssh wbadm@buildd -S $SSH_SOCKET trigger.security $send done fi