]> git.donarmstrong.com Git - debbugs.git/blob - examples/debian/versions/update-mldbm
c4e3786feeca643d66afb621469bc87699e98872
[debbugs.git] / examples / debian / versions / update-mldbm
1 #! /bin/sh -e
2
3 cd /org/bugs.debian.org/versions/indices
4
5 ARCHIVES='ftp' # security -- should be included too, but too difficult to deal with
6
7 # Nuke old versions of versions.idx.new in case there's one hanging about
8 rm -f versions.idx.new
9 # This index is much larger and keeps track of historic versions of
10 # packages, and is used for expiring bugs
11 rm -f versions_time.idx.new
12 if [ -e versions_time.idx ]; then
13     cp versions_time.idx versions_time.idx.new;
14 fi;
15
16 set -e
17 for archive in $ARCHIVES; do
18     case $archive in
19         ftp)
20             SUITES='oldstable stable proposed-updates testing testing-proposed-updates unstable experimental'
21             di_main='main main/debian-installer'
22             ;;
23         nonus)
24             SUITES='oldstable'
25             di_main='main'
26             ;;
27         security)
28             SUITES='oldstable stable testing'
29             di_main='main'
30             ;;
31     esac
32     for suite in $SUITES; do
33         if [ "$suite" != "oldstable" ] || [ -d /org/bugs.debian.org/etc/indices/$archive/$suite ]; then
34         case $suite in
35             oldstable)
36                 ARCHES='alpha amd64 arm hppa i386 ia64 m68k mips mipsel powerpc s390 sparc'
37                 ;;
38             stable|proposed-updates)
39                 ARCHES='alpha amd64 arm hppa i386 ia64 mips mipsel powerpc s390 sparc'
40                 ;;
41             testing|testing-proposed-updates)
42                 ARCHES='alpha amd64 arm hppa i386 ia64 mips mipsel powerpc s390 sparc'
43                 ;;
44             unstable|experimental)
45                 ARCHES='alpha amd64 arm hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 sparc'
46                 ;;
47         esac
48         case $suite in
49             oldstable|experimental)
50                 COMPONENTS='main contrib non-free'
51                 ;;
52             stable|proposed-updates|testing|testing-proposed-updates|unstable)
53                 COMPONENTS="$di_main contrib non-free"
54                 ;;
55         esac
56         for component in $COMPONENTS; do
57             for arch in $ARCHES; do
58                 zcat "/org/bugs.debian.org/etc/indices/$archive/$suite/$component/binary-$arch/Packages.gz" | ../bin/build-mldbm.pl "$archive" "$suite" "$arch"
59             done
60             if [ "$component" != main/debian-installer ]; then
61                 zcat "/org/bugs.debian.org/etc/indices/$archive/$suite/$component/source/Sources.gz" | ../bin/build-mldbm.pl "$archive" "$suite" source
62             fi
63         done
64         fi
65     done
66 done
67
68 # This removes old versions
69 ../bin/versions_time_cleanup
70
71 chmod 664 versions.idx.new
72 mv versions.idx.new versions.idx
73
74 chmod 664 versions_time.idx.new
75 mv versions_time.idx.new versions_time.idx