]> git.decadent.org.uk Git - dak.git/blob - config/backports/cron.unchecked
Eliminate all references to apt.conf
[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 set -o pipefail
21 # make sure to only use defined variables
22 set -u
23 # ERR traps should be inherited from functions too. (And command
24 # substitutions and subshells and whatnot, but for us the functions is
25 # the important part here)
26 set -E
27
28 export SCRIPTVARS=/srv/backports-master.debian.org/dak/config/backports/vars
29 . $SCRIPTVARS
30
31
32 LOCKDAILY=""
33 LOCKFILE="$lockdir/unchecked.lock"
34 LOCK_NEW="$lockdir/processnew.lock"
35 NOTICE="$lockdir/daily.lock"
36 LOCK_BUILDD="$lockdir/buildd.lock"
37 # The state file telling us we have something new to do
38 DINSTALLPACKAGES="${lockdir}/dinstall.packages"
39
40 # our name
41 PROGRAM="unchecked"
42
43 if [ -e $NOTICE ]; then
44     exit 0;
45 fi
46
47 ########################################################################
48 # Functions                                                            #
49 ########################################################################
50 # common functions are "outsourced"
51 . "${configdir}/common"
52
53 STAMP=$(date "+%Y%m%d%H%M")
54
55 cleanup() {
56     rm -f "$LOCKFILE"
57     if [ ! -z "$LOCKDAILY" ]; then
58         rm -f "$NOTICE"
59     fi
60 }
61
62 function do_buildd () {
63     if lockfile -r3 $NOTICE; then
64         LOCKDAILY="YES"
65         cd $overridedir
66         dak make-overrides &>/dev/null
67         rm -f override.sid.all3 override.sid.all3.src
68         for i in main contrib non-free main.debian-installer; do
69             cat override.squeeze-backports.$i >> override.sid.all3
70             if [ "$i" != "main.debian-installer" ]; then
71                 cat override.squeeze-backports.$i.src >> override.sid.all3.src
72             fi
73         done
74         make_buildd_dir
75         wbtrigger
76     fi
77 }
78
79 function do_dists () {
80     cd $configdir
81     dak generate-filelist
82     dak generate-packages-sources
83 }
84
85 ########################################################################
86 # the actual unchecked functions follow                                #
87 ########################################################################
88
89 # And use one locale, no matter what the caller has set
90 export LANG=C
91 export LC_ALL=C
92
93 # only run one cron.unchecked
94 lockfile -r3 $LOCKFILE || exit 0
95 trap cleanup 0
96
97 do_newstage
98 do_unchecked
99
100 if [ ! -z "$changes" ]; then
101     touch ${DINSTALLPACKAGES}
102     sync_debbugs
103     do_buildd
104
105 #    echo "Starting g-p-s: $(date +%H:%M:%S)"
106 #    do_dists
107 #    echo "Done with g-p-s: $(date +%H:%M:%S)"
108 fi