]> git.decadent.org.uk Git - dak.git/blob - config/debian-security/cron.daily
Fixup the indentation tab mess
[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 # disabled by ajt 2008-01-01: requires auth
14 rsync --password-file /srv/non-us.debian.org/s3kr1t/rsync-password -ql security-master@ftp-master::indices/override\* $overridedir
15
16 cd $overridedir
17 find . -name override\*.gz -type f -maxdepth 1 -mindepth 1 | xargs gunzip -f
18 find . -type l -maxdepth 1 -mindepth 1 | xargs --no-run-if-empty rm
19
20 for suite in $suites; do
21     case $suite in
22                 oldstable) override_suite=sarge;;
23                 stable) override_suite=etch;;
24                 testing) override_suite=lenny;;
25                 *) echo "Unknown suite type ($suite)"; exit 1;;
26     esac
27     for component in $components; do
28                 for override_type in $override_types; do
29                         case $override_type in
30                                 deb) type="" ;;
31                                 dsc) type=".src" ;;
32                                 udeb) type=".debian-installer" ;;
33                         esac
34                         #XXX RUN AFUCKINGAWAY
35                         if [ "$override_type" = "udeb" ]; then
36                                 if [ ! "$component" = "main" ]; then
37                                         continue
38                                 fi
39                                 if [ "$suite" = "unstable" ]; then
40                                         dak control-overrides -q -S -t $override_type -s $suite -c updates/$component < override.$override_suite.$component$type
41                                 fi
42                         else
43                                 # XXX removed 2007-08-16 ajt
44                                 #dak control-overrides -q -S -t $override_type -s $suite -c updates/$component < override.$override_suite.$component$type
45                                 true
46                         fi
47                         case $suite in
48                                 oldstable)
49                                         dak control-overrides -q -a -t $override_type -s $suite -c updates/$component < override.sid.$component$type
50                                         ;;
51                                 stable)
52                                         dak control-overrides -q -a -t $override_type -s $suite -c updates/$component < override.sid.$component$type
53                                         ;;
54                                 testing)
55                                         dak control-overrides -q -a -t $override_type -s $suite -c updates/$component < override.sid.$component$type
56                                         ;;
57                                 *) echo "Unknown suite type ($suite)"; exit 1;;
58                         esac
59                 done
60     done
61 done
62
63 # Generate .all3 overides for the buildd support
64 for dist in sarge etch lenny; do
65     rm -f override.$dist.all3
66     components="main contrib non-free";
67     if [ -f override.$dist.main.debian-installer ]; then
68                 components="$components main.debian-installer"
69     fi
70     for component in $components; do
71                 cat override.$dist.$component >> override.$dist.all3
72         if [ -e "override.$dist.$component.src" ]; then
73                         cat override.$dist.$component.src >> override.$dist.all3.src
74                 fi
75     done
76 done
77
78 ################################################################################
79
80 # Freshen Packages-Arch-Specific
81 wget -qN http://buildd.debian.org/quinn-diff/Packages-arch-specific -O $base/buildd/Packages-arch-specific
82
83 ################################################################################
84
85 cd $masterdir
86 dak clean-queues
87 dak clean-suites
88 apt-ftparchive -q clean apt.conf
89 apt-ftparchive -q clean apt.conf.buildd
90
91 symlinks -d -r $ftpdir
92
93 pg_dump obscurity > /org/security.debian.org/dak-backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
94
95 # Vacuum the database
96 set +e
97 echo "VACUUM; VACUUM ANALYZE;" | psql obscurity 2>&1 | egrep -v "^NOTICE:  Skipping \"pg_.*only table or database owner can VACUUM it$|^VACUUM$"
98 set -e
99
100 ################################################################################