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