]> git.decadent.org.uk Git - dak.git/blob - config/debian-security/cron.unchecked
dak/new_security_install.py: Update for multiarchive changes.
[dak.git] / config / debian-security / cron.unchecked
1 #! /bin/bash
2
3 set -e
4 set -o pipefail
5 set -u
6
7 export SCRIPTVARS=/srv/security-master.debian.org/dak/config/debian-security/vars
8 . $SCRIPTVARS
9
10 # And use one locale, no matter what the caller has set
11 export LANG=C
12 export LC_ALL=C
13
14 report=$queuedir/REPORT
15 reportdis=$queuedir/REPORT.disembargo
16 timestamp=$(date "+%Y-%m-%d %H:%M")
17 doanything=false
18 dopolicy=false
19 LOCKFILE="$lockdir/unchecked.lock"
20
21 # So first we should go and see if any process-policy action is done
22 dak process-policy embargoed | mail -a "X-Debian: DAK" -e -s "Automatically accepted from embargoed" team@security.debian.org -- -F "Debian FTP Masters" -f ftpmaster@ftp-master.debian.org
23 dak process-policy unembargoed | mail -a "X-Debian: DAK" -e -s "Automatically accepted from unembargoed" team@security.debian.org -- -F "Debian FTP Masters" -f ftpmaster@ftp-master.debian.org
24
25 # Now, if this really did anything, we can then sync it over. Files
26 # in newstage mean they are (late) accepts of security stuff, need
27 # to sync to ftp-master
28
29 cleanup() {
30     rm -f "$LOCKFILE"
31 }
32
33 if ! lockfile -r8 "$LOCKFILE"; then
34     echo "aborting cron.unchecked because $LOCKFILE has already been locked"
35     exit 0
36 fi
37 trap cleanup EXIT
38
39 cd $newstage
40 changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs)
41 if [ -n "$changes" ]; then
42     dopolicy=true
43     echo "$timestamp": ${changes:-"Nothing to do in newstage"}  >> $report
44     rsync -a -q $newstage/. /srv/queued/ftpmaster/.
45     dak process-upload -a -d "$newstage" >> $report
46 fi
47
48 cd $unchecked
49 changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs)
50 if [ -n "$changes" ]; then
51     doanything=true
52     echo "$timestamp": ${changes:-"Nothing to do in unchecked"}  >> $report
53     dak process-upload -a -d "$unchecked" >> $report
54 fi
55
56 cd $disembargo
57 changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs)
58
59 if [ -n "$changes" ]; then
60     doanything=true
61     echo "$timestamp": ${changes:-"Nothing to do in disembargo"}  >> $reportdis
62     dak process-upload -a -d "$disembargo" >> $reportdis
63 fi
64
65 if [ "${doanything}" = "false" ] && [ "${dopolicy}" = "false" ]; then
66     echo "$timestamp": Nothing to do >> $report
67     exit 0
68 fi
69
70 dak manage-build-queues -a
71
72 if [ "x${dopolicy}x" = "xtruex" ]; then
73     # We had something approved from a policy queue, push out new archive
74     dak dominate
75     #dak generate-filelist
76     cd $configdir
77     $configdir/map.sh
78     #apt-ftparchive generate apt.conf
79     dak generate-packages-sources2
80     dak generate-releases
81     /srv/security-master.debian.org/dak/config/debian-security/make-mirror.sh
82     sudo -u archvsync -H /home/archvsync/signal_security
83 fi
84
85 cleanup
86 trap - EXIT
87
88 $configdir/cron.buildd