]> git.decadent.org.uk Git - dak.git/blob - config/debian/cron.unchecked
Add ssh-move script, and use it to sync versioning info across to bugs.debian.org
[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 cleanup() {
13   rm -f "$LOCKFILE"
14   if [ ! -z "$LOCKDAILY" ]; then
15           rm -f "$NOTICE"
16   fi
17 }
18
19 # only run one cron.unchecked
20 if lockfile -r3 $LOCKFILE; then
21         trap cleanup 0
22         cd $unchecked
23
24         changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs)
25         report=$queuedir/REPORT
26         timestamp=$(date "+%Y-%m-%d %H:%M")
27
28         if [ ! -z "$changes" ]; then
29                 echo "$timestamp": "$changes"  >> $report
30                 dak process-unchecked -a $changes >> $report
31                 echo "--" >> $report
32
33                 # sync with debbugs
34                 $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
35
36                 if lockfile -r3 $NOTICE; then
37                         LOCKDAILY="YES"
38                         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
39                         cd $overridedir
40                         dak make-overrides &>/dev/null
41                         rm -f override.sid.all3 override.sid.all3.src
42                         for i in main contrib non-free main.debian-installer; do
43                                 cat override.sid.$i >> override.sid.all3
44                                 if [ "$i" != "main.debian-installer" ]; then
45                                         cat override.sid.$i.src >> override.sid.all3.src
46                                 fi
47                         done
48                         cd $configdir
49                         apt-ftparchive -qq -o APT::FTPArchive::Contents=off generate apt.conf.buildd
50                         . $configdir/cron.buildd
51                 fi
52         else
53                 echo "$timestamp": Nothing to do >> $report
54         fi
55 fi