]> git.decadent.org.uk Git - dak.git/blob - config/debian-security/cron.daily
control-overrides: Add some safer modes of operation
[dak.git] / config / debian-security / cron.daily
1 #!/bin/sh
2 #
3 # Executed daily via cron, out of dak's crontab.
4
5 set -e
6 export SCRIPTVARS=/org/security.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/non-us.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=etch;;
24                 stable) override_suite=lenny;;
25                 testing) override_suite=squeeze;;
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 etch lenny squeeze; 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 $masterdir
64 dak clean-queues
65 dak clean-suites
66 apt-ftparchive -q clean apt.conf
67 apt-ftparchive -q clean apt.conf.buildd
68
69 symlinks -d -r $ftpdir
70
71 pg_dump obscurity > /org/security.debian.org/dak-backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
72
73 # Vacuum the database
74 set +e
75 echo "VACUUM; VACUUM ANALYZE;" | psql obscurity 2>&1 | egrep -v "^NOTICE:  Skipping \"pg_.*only table or database owner can VACUUM it$|^VACUUM$"
76 set -e
77
78 ################################################################################