]> git.decadent.org.uk Git - dak.git/blob - config/debian-security/cron.buildd
debianqueued: avoid removing .tar.bz2 files too early
[dak.git] / config / debian-security / cron.buildd
1 #! /bin/bash
2 #
3 # Executed after cron.unchecked
4
5 ARCHS_oldstable="alpha amd64 arm hppa i386 ia64 mips mipsel powerpc sparc s390"
6 ARCHS_stable="alpha amd64 arm armel hppa i386 ia64 mips mipsel powerpc sparc s390"
7 ARCHS_testing="alpha amd64 armel hppa i386 ia64 mips mipsel powerpc sparc s390"
8 DISTS="oldstable stable testing"
9 SSH_SOCKET=~/.ssh/buildd.debian.org.socket
10
11 set -e
12 export SCRIPTVARS=/org/security.debian.org/dak/config/debian-security/vars
13 . $SCRIPTVARS
14
15 if [ -e $ftpdir/Archive_Maintenance_In_Progress ]; then
16         exit 0
17 fi
18
19 cd $masterdir
20 for d in $DISTS; do
21         eval SOURCES_$d=`stat -c "%Y" $base/buildd/$d/Sources.gz`
22         eval PACKAGES_$d=`stat -c "%Y" $base/buildd/$d/Packages.gz`
23 done
24
25 apt-ftparchive -qq -o APT::FTPArchive::Contents=off generate apt.conf.buildd
26 dists=
27 for d in $DISTS; do
28         eval NEW_SOURCES_$d=`stat -c "%Y" $base/buildd/$d/Sources.gz`
29         eval NEW_PACKAGES_$d=`stat -c "%Y" $base/buildd/$d/Packages.gz`
30         old=SOURCES_$d
31         new=NEW_$old
32         if [ ${!new} -gt ${!old} ]; then
33                 if [ -z "$dists" ]; then
34                         dists="$d"
35                 else
36                         dists="$dists $d"
37                 fi
38                 continue
39         fi
40         old=PACKAGES_$d
41         new=NEW_$old
42         if [ ${!new} -gt ${!old} ]; then
43                 if [ -z "$dists" ]; then
44                         dists="$d"
45                 else
46                         dists="$dists $d"
47                 fi
48                 continue
49         fi
50 done
51
52 if [ ! -z "$dists" ]; then
53         # setup ssh master process
54         ssh wbadm@buildd -S $SSH_SOCKET -MN 2> /dev/null &
55         SSH_PID=$!
56         while [ ! -S $SSH_SOCKET ]; do
57                 sleep 1
58         done
59         trap 'kill -TERM $SSH_PID' 0
60         for d in $dists; do
61                 ssh wbadm@buildd -S $SSH_SOCKET trigger.security $d
62         done
63 fi
64