]> git.decadent.org.uk Git - dak.git/blob - config/debian-security/cron.daily
modify new-security-install to allow multiple packages accepted at once
[dak.git] / config / debian-security / cron.daily
1 #!/bin/bash
2 #
3 # Executed daily via cron, out of dak's crontab.
4
5 set -e
6 export SCRIPTVARS=/srv/security-master.debian.org/dak/config/debian-security/vars
7 . $SCRIPTVARS
8
9 ################################################################################
10
11 # Fix overrides
12
13 rsync --delete -r --include=override\* --exclude=\* --password-file /srv/security-master.debian.org/s3kr1t/rsync-password -ql security-master@ftp-master::indices/ $overridedir
14
15 cd $overridedir
16 for file in override*.gz; do
17         zcat $file > $(basename $file .gz)
18 done
19 find . -maxdepth 1 -mindepth 1 -type l | xargs --no-run-if-empty rm
20
21 for suite in $suites; do
22     case $suite in
23                 oldstable) override_suite=lenny;;
24                 stable) override_suite=squeeze;;
25                 testing) override_suite=wheezy;;
26                 *) echo "Unknown suite type ($suite)"; exit 1;;
27     esac
28     for component in $components; do
29                 for override_type in $override_types; do
30                         case $override_type in
31                                 deb) type="" ;;
32                                 dsc) type=".src" ;;
33                                 udeb) type=".debian-installer" ;;
34                         esac
35
36                         if [ "$override_type" = "udeb" ]; then
37                                 if [ ! "$component" = "main" ]; then
38                                         continue
39                                 fi
40                         fi
41                         zcat override.$override_suite.$component$type.gz | dak control-overrides -q -a -t $override_type -s $suite -c updates/$component
42                 done
43     done
44 done
45
46 # Generate .all3 overides for the buildd support
47 for dist in lenny squeeze wheezy; do
48     rm -f override.$dist.all3
49     components="main contrib non-free";
50     if [ -f override.$dist.main.debian-installer.gz ]; then
51                 components="$components main.debian-installer"
52     fi
53     for component in $components; do
54                 zcat override.$dist.$component.gz >> override.$dist.all3
55         if [ -e "override.$dist.$component.src.gz" ]; then
56                         zcat override.$dist.$component.src.gz >> override.$dist.all3.src
57                 fi
58     done
59 done
60
61 ################################################################################
62
63 cd $configdir
64 dak import-keyring -L /srv/keyring.debian.org/keyrings/debian-keyring.gpg
65 dak clean-queues
66 dak clean-queues -i $disembargo
67 dak clean-suites
68
69 symlinks -d -r $ftpdir
70
71 pg_dump obscurity > /org/security-master.debian.org/dak-backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
72 find -maxdepth 1 -mindepth 1 -type f -name 'dump_*' \! -name '*.bz2' \! -name '*.gz' -mmin +720 |
73 while read dumpname; do
74     bzip2 -9fv "$dumpname"
75 done
76
77 apt-ftparchive -q clean apt.conf
78 apt-ftparchive -q clean apt.conf.buildd
79
80 ################################################################################