]> git.decadent.org.uk Git - dak.git/blob - scripts/debian/mkmaintainers
Use string object methods rather than string module.
[dak.git] / scripts / debian / mkmaintainers
1 #! /bin/sh
2
3 echo
4 echo -n 'Creating Maintainers index ... '
5
6 set -e
7 . $SCRIPTVARS
8 cd $masterdir
9
10 nonusmaint="$masterdir/Maintainers_Versions-non-US"
11
12
13 if wget -T15 -q -O Maintainers_Versions-non-US.gz http://non-us.debian.org/indices-non-US/Maintainers_Versions.gz; then
14         rm -f $nonusmaint
15         gunzip -c ${nonusmaint}.gz > $nonusmaint
16         rm -f ${nonusmaint}.gz
17 fi
18
19 cd $indices
20 dak make-maintainers $nonusmaint $masterdir/pseudo-packages.maintainers | sed -e "s/~[^  ]*\([   ]\)/\1/"  | awk '{printf "%-20s ", $1; for (i=2; i<=NF; i++) printf "%s ", $i; printf "\n";}' > .new-maintainers
21
22 set +e
23 cmp .new-maintainers Maintainers >/dev/null
24 rc=$?
25 set -e
26 if [ $rc = 1 ] || [ ! -f Maintainers ] ; then
27         echo -n "installing Maintainers ... "
28         mv -f .new-maintainers Maintainers
29         gzip -9v <Maintainers >.new-maintainers.gz
30         mv -f .new-maintainers.gz Maintainers.gz
31 elif [ $rc = 0 ] ; then
32         echo '(same as before)'
33         rm -f .new-maintainers
34 else
35         echo cmp returned $rc
36         false
37 fi