]> git.decadent.org.uk Git - dak.git/blob - config/debian-security/cron.buildd
Fix case of an empty transitions file and accept debian native versions in transitions
[dak.git] / config / debian-security / cron.buildd
1 #! /bin/bash
2 #
3 # Executed after cron.unchecked
4
5 ARCHS_oldstable="alpha arm hppa i386 ia64 m68k mips mipsel powerpc sparc s390 amd64"
6 ARCHS_stable="alpha amd64 arm hppa i386 ia64 mips mipsel powerpc sparc s390"
7 ARCHS_testing="$ARCHS_stable"
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 buildd@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                 archs=ARCHS_$d
62                 ARCHS=${!archs}
63                 cd /org/security.debian.org/buildd/$d
64                 if [ "$d" != "oldstable" ]; then
65                         # disabled for oldstable-security by ajt 2008-01-01
66                         for a in $ARCHS; do
67                                 quinn-diff -a /org/security.debian.org/buildd/Packages-arch-specific -A $a 2>/dev/null | ssh buildd@buildd -S $SSH_SOCKET wanna-build -d $d-security -b $a/build-db --merge-partial-quinn
68
69                                 ssh buildd@buildd -S $SSH_SOCKET wanna-build -d $d-security -A $a -b $a/build-db --merge-packages < Packages
70                         done
71                 else
72                         ssh buildd@bester.farm.ftbfs.de -i ~/.ssh/id_bester sleep 1
73                 fi
74         done
75 fi
76