]> git.decadent.org.uk Git - dak.git/blob - config/debian/cron.unchecked
[??] sync with ftp-master/dak master
[dak.git] / config / debian / cron.unchecked
1 #! /bin/sh
2
3 set -e
4 set -u
5 export SCRIPTVARS=/srv/ftp.debian.org/dak/config/debian/vars
6 . $SCRIPTVARS
7
8 LOCKDAILY=""
9 LOCKFILE="$lockdir/unchecked.lock"
10 NOTICE="$lockdir/daily.lock"
11
12 if [ -e $NOTICE ]; then exit 0; fi
13
14 cleanup() {
15   rm -f "$LOCKFILE"
16   if [ ! -z "$LOCKDAILY" ]; then
17           rm -f "$NOTICE"
18   fi
19 }
20
21 # only run one cron.unchecked
22 if lockfile -r3 $LOCKFILE; then
23         trap cleanup 0
24         cd $unchecked
25
26         changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs)
27         report=$queuedir/REPORT
28         timestamp=$(date "+%Y-%m-%d %H:%M")
29
30         if [ ! -z "$changes" ]; then
31                 echo "$timestamp": "$changes"  >> $report
32                 dak process-unchecked -a $changes >> $report
33                 echo "--" >> $report
34
35                 # sync with debbugs
36                 $scriptsdir/ssh-move --server --ssh-identity /srv/ftp.debian.org/s3kr1t/id_debbugs-vt --ssh-move-path /home/debbugs/ssh-move --from-directory $queuedir/bts_version_track --to-directory /org/bugs.debian.org/versions/queue/ftp-master debbugs@bugs.debian.org \*.debinfo \*.versions
37
38                 if lockfile -r3 $NOTICE; then
39                         LOCKDAILY="YES"
40                         psql projectb -A -t -q -c "SELECT filename FROM queue_build WHERE queue = 0 AND suite = 5 AND in_queue = true AND filename ~ 'd(sc|eb)$'" > $dbdir/dists/unstable_accepted.list
41                         cd $overridedir
42                         dak make-overrides &>/dev/null
43                         rm -f override.sid.all3 override.sid.all3.src
44                         for i in main contrib non-free main.debian-installer; do
45                                 cat override.sid.$i >> override.sid.all3
46                                 if [ "$i" != "main.debian-installer" ]; then
47                                         cat override.sid.$i.src >> override.sid.all3.src
48                                 fi
49                         done
50                         cd $configdir
51                         apt-ftparchive -qq -o APT::FTPArchive::Contents=off generate apt.conf.buildd
52                         . $configdir/cron.buildd
53                 fi
54         else
55                 echo "$timestamp": Nothing to do >> $report
56         fi
57 fi