]> git.donarmstrong.com Git - debbugs.git/blob - examples/debian/versions/update-mldbm
3bb03bc765302addad8ba1d7f4ac9dee27f53929
[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|stable|proposed-updates)
36                 ARCHES='alpha amd64 arm hppa i386 ia64 m68k mips mipsel powerpc s390 sparc'
37                 ;;
38             testing|testing-proposed-updates)
39                 ARCHES='alpha amd64 arm hppa i386 ia64 mips mipsel powerpc s390 sparc'
40                 ;;
41             unstable|experimental)
42                 ARCHES='alpha amd64 arm hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 sparc'
43                 ;;
44         esac
45         case $suite in
46             oldstable|experimental)
47                 COMPONENTS='main contrib non-free'
48                 ;;
49             stable|proposed-updates|testing|testing-proposed-updates|unstable)
50                 COMPONENTS="$di_main contrib non-free"
51                 ;;
52         esac
53         for component in $COMPONENTS; do
54             for arch in $ARCHES; do
55                 zcat "/org/bugs.debian.org/etc/indices/$archive/$suite/$component/binary-$arch/Packages.gz" | ../bin/build-mldbm.pl "$archive" "$suite" "$arch"
56             done
57             if [ "$component" != main/debian-installer ]; then
58                 zcat "/org/bugs.debian.org/etc/indices/$archive/$suite/$component/source/Sources.gz" | ../bin/build-mldbm.pl "$archive" "$suite" source
59             fi
60         done
61         fi
62     done
63 done
64
65 # This removes old versions
66 ../bin/versions_time_cleanup
67
68 chmod 664 versions.idx.new
69 mv versions.idx.new versions.idx
70
71 chmod 664 versions_time.idx.new
72 mv versions_time.idx.new versions_time.idx