]> git.decadent.org.uk Git - dak.git/blob - config/backports/cron.unchecked
remove lenny
[dak.git] / config / backports / cron.unchecked
1 #! /bin/bash
2
3 # Copyright (C) 2009 Joerg Jaspert <joerg@debian.org>
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License as
7 # published by the Free Software Foundation; version 2.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 # exit on errors
19 set -e
20 # make sure to only use defined variables
21 set -u
22 # ERR traps should be inherited from functions too. (And command
23 # substitutions and subshells and whatnot, but for us the functions is
24 # the important part here)
25 set -E
26
27 export SCRIPTVARS=/srv/backports-master.debian.org/dak/config/backports/vars
28 . $SCRIPTVARS
29
30
31 LOCKDAILY=""
32 LOCKFILE="$lockdir/unchecked.lock"
33 LOCK_NEW="$lockdir/processnew.lock"
34 NOTICE="$lockdir/daily.lock"
35 LOCK_BUILDD="$lockdir/buildd.lock"
36 # The state file telling us we have something new to do
37 DINSTALLPACKAGES="${lockdir}/dinstall.packages"
38
39 # our name
40 PROGRAM="unchecked"
41
42 if [ -e $NOTICE ]; then
43     exit 0;
44 fi
45
46 ########################################################################
47 # Functions                                                            #
48 ########################################################################
49 # common functions are "outsourced"
50 . "${configdir}/common"
51
52 STAMP=$(date "+%Y%m%d%H%M")
53
54 cleanup() {
55     rm -f "$LOCKFILE"
56     if [ ! -z "$LOCKDAILY" ]; then
57         rm -f "$NOTICE"
58     fi
59 }
60
61 function do_buildd () {
62     if lockfile -r3 $NOTICE; then
63         LOCKDAILY="YES"
64         cd $overridedir
65         dak make-overrides &>/dev/null
66         rm -f override.sid.all3 override.sid.all3.src
67         for i in main contrib non-free main.debian-installer; do
68             cat override.squeeze-backports.$i >> override.sid.all3
69             if [ "$i" != "main.debian-installer" ]; then
70                 cat override.squeeze-backports.$i.src >> override.sid.all3.src
71             fi
72         done
73         make_buildd_dir
74         wbtrigger
75     fi
76 }
77
78 function do_dists () {
79     cd $configdir
80     dak generate-filelist
81     dak generate-packages-sources
82 }
83
84 ########################################################################
85 # the actual unchecked functions follow                                #
86 ########################################################################
87
88 # And use one locale, no matter what the caller has set
89 export LANG=C
90 export LC_ALL=C
91
92 # only run one cron.unchecked
93 lockfile -r3 $LOCKFILE || exit 0
94 trap cleanup 0
95
96 do_newstage
97 do_unchecked
98
99 if [ ! -z "$changes" ]; then
100     touch ${DINSTALLPACKAGES}
101     sync_debbugs
102     do_buildd
103
104 #    echo "Starting g-p-s: $(date +%H:%M:%S)"
105 #    do_dists
106 #    echo "Done with g-p-s: $(date +%H:%M:%S)"
107 fi