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