3 # Updates wanna-build databases after the archive maintenance
7 DISTS="oldstable-security stable stable-security testing testing-security unstable"
8 SECTIONS="main contrib non-free"
9 ARCHS_oldstable="m68k arm sparc alpha powerpc i386"
10 ARCHS_stable="mips mipsel ia64 hppa s390 $ARCHS_oldstable"
11 ARCHS_testing="$ARCHS_stable"
12 ARCHS_unstable="$ARCHS_testing hurd-i386 sh"
13 TMPDIR="/org/wanna-build/tmp"
14 WGETOPT="-q -t2 -w0 -T60"
15 CURLOPT="-q -s -S -f -K /org/wanna-build/trigger.curlrc"
16 LOCKFILE="/org/wanna-build/tmp/DB_Maintenance_In_Progress"
20 echo Updating wanna-build databases...
23 if [ "$DAY" = "0" ]; then
24 savelog -c 26 -p /org/wanna-build/db/merge.log
27 exec >> /org/wanna-build/db/merge.log 2>&1
28 lockfile -l 3600 $LOCKFILE
34 echo -------------------------------------------------------------------------
35 echo "merge triggered `date`"
40 # Make one big Packages and Sources file.
43 dist=`echo $d | sed s/-.*$//`
46 ARCHS="$ARCHS_oldstable"
52 ARCHS="$ARCHS_testing"
55 ARCHS="$ARCHS_unstable"
58 NON_US="false" # this is changed below if sources can be found
60 if [ "$d" = "unstable" ]; then
61 gzip -dc /org/incoming.debian.org/buildd/Sources.gz >> Sources.$d
64 rm -f Packages.$d.$a quinn-$d.$a
65 if [ "$d" = "unstable" ]; then
66 gzip -dc /org/incoming.debian.org/buildd/Packages.gz >> Packages.$d.$a
71 for s in $SECTIONS ; do
72 if echo $d | grep -qv -- -security; then
74 if wget $WGETOPT http://non-us.debian.org/debian-non-US/dists/$d/non-US/$s/source/Sources.gz; then
75 mv Sources.gz Sources-non-us.$d.$s.gz
78 gzip -dc Sources-non-us.$d.$s.gz >> Sources.$d
79 gzip -dc /org/ftp.debian.org/ftp/dists/$d/$s/source/Sources.gz >> Sources.$d
80 if [ "$d" = "testing" -o "$d" = "stable" ]; then
81 if wget $WGETOPT http://non-us.debian.org/debian-non-US/dists/$d-proposed-updates/non-US/$s/source/Sources.gz; then
82 mv Sources.gz Sources-non-us.$d-p-u.$s.gz
84 gzip -dc Sources-non-us.$d-p-u.$s.gz >> Sources.$d
85 gzip -dc /org/ftp.debian.org/ftp/dists/$d-proposed-updates/$s/source/Sources.gz >> Sources.$d
90 if [ "$NON_US" = "true" ]; then
91 if wget $WGETOPT http://non-us.debian.org/debian-non-US/dists/$d/non-US/$s/binary-$a/Packages.gz; then
92 mv Packages.gz Packages-non-us.$d.$s.$a.gz
95 gzip -dc Packages-non-us.$d.$s.$a.gz >> Packages.$d.$a
97 gzip -dc /org/ftp.debian.org/ftp/dists/$d/$s/binary-$a/Packages.gz >> Packages.$d.$a
98 if [ "$d" = "testing" -o "$d" = "stable" ]; then
99 if [ "$NON_US" = "true" ]; then
100 if wget $WGETOPT http://non-us.debian.org/debian-non-US/dists/$d-proposed-updates/non-US/$s/binary-$a/Packages.gz; then
101 mv Packages.gz Packages-non-us.$d-p-u.$s.$a.gz
104 gzip -dc Packages-non-us.$d-p-u.$s.$a.gz >> Packages.$d.$a
105 gzip -dc /org/ftp.debian.org/ftp/dists/$d-proposed-updates/$s/binary-$a/Packages.gz >> Packages.$d.$a
107 if [ "$d" = "unstable" -a "$s" = "main" ]; then
108 gzip -dc /org/ftp.debian.org/ftp/dists/$d/$s/debian-installer/binary-$a/Packages.gz >> Packages.$d.$a
113 if wget $WGETOPT http://security.debian.org/debian-security/dists/$dist/updates/$s/source/Sources.gz; then
114 mv Sources.gz Sources-$d.$s.gz
116 gzip -dc Sources-$d.$s.gz >> Sources.$d
117 if [ "$s" = "main" ]; then
118 if curl $CURLOPT http://security.debian.org/buildd/$dist/Sources.gz -o Sources.gz; then
119 mv Sources.gz Sources-$d.accepted.gz
121 gzip -dc Sources-$d.accepted.gz >> Sources.$d
122 if curl $CURLOPT http://security.debian.org/buildd/$dist/Packages.gz -o Packages.gz; then
123 mv Packages.gz Packages-$d.accepted.gz
128 if wget $WGETOPT http://security.debian.org/debian-security/dists/$dist/updates/$s/binary-$a/Packages.gz; then
129 mv Packages.gz Packages.$d.$s.$a.gz
131 gzip -dc Packages.$d.$s.$a.gz >> Packages.$d.$a
132 if [ "$s" = "main" ]; then
133 gzip -dc Packages.$d.accepted.gz >> Packages.$d.$a
139 if [ "$d" = "oldstable" ]; then
140 gzip -dc /org/ftp.debian.org/ftp/dists/old-proposed-updates/Sources.gz >> Sources.$d
141 if "$NON_US" = "true" ]; then
143 if wget $WGETOPT http://non-us.debian.org/debian-non-US/dists/old-proposed-updates/Sources.gz; then
144 mv Sources.gz Sources-non-us.p-u.gz
146 gzip -dc Sources-non-us.p-u.gz >> Sources.$d
148 if wget $WGETOPT http://non-us.debian.org/debian-non-US/dists/old-proposed-updates/Packages.gz; then
149 mv Packages.gz Packages-non-us.p-u.gz
154 gzip -dc /org/ftp.debian.org/ftp/dists/old-proposed-updates/Packages.gz >> Packages.$d.$a
155 gzip -dc Packages-non-us.p-u.gz >> Packages.$d.$a
159 quinn-diff -A $a -a /org/buildd.debian.org/web/quinn-diff/Packages-arch-specific -s Sources.$d -p Packages.$d.$a >> quinn-$d.$a
164 for a in $ARCHS_unstable ; do
165 wanna-build --create-maintenance-lock --database=$a/build-db
168 dist=`echo $d | sed s/-.*$//`
171 if echo $ARCHS_stable | grep -q -v "\b$a\b"; then
176 if echo $ARCHS_testing | grep -q -v "\b$a\b"; then
181 if echo $ARCHS_unstable | grep -q -v "\b$a\b"; then
186 wanna-build --merge-packages --arch=$a --dist=$d --database=$a/build-db Packages.$d.$a
187 perl -pi -e 's#^(non-US/)?(non-free)/.*$##msg' quinn-$d.$a
188 wanna-build --merge-quinn --dist=$d --database=$a/build-db quinn-$d.$a
189 wanna-build --merge-sources --dist=$d --database=$a/build-db Sources.$d
190 mv Packages.$d.$a Packages.$d.$a-old
191 mv quinn-$d.$a quinn-$d.$a-old
192 if [ "$DAY" = "0" -a "$d" = "unstable" ]; then
193 savelog -p -c 26 /org/wanna-build/db/$a/transactions.log
196 wanna-build --remove-maintenance-lock --database=$a/build-db
200 mv Sources.$d Sources.$d-old
203 echo "merge ended `date`"
206 /org/wanna-build/bin/wb-graph >> /org/wanna-build/etc/graph-data
207 /org/wanna-build/bin/wb-graph -p >> /org/wanna-build/etc/graph2-data
208 /org/buildd.debian.org/bin/makegraph