]> git.decadent.org.uk Git - dak.git/blob - scripts/debian/update-mirrorlists
Use string object methods rather than string module.
[dak.git] / scripts / debian / update-mirrorlists
1 #!/bin/sh
2 #
3 # Very Very hackish script...  dont laugh.
4 # Michael Beattie <mjb@debian.org>
5
6 . vars
7
8 prog=$scriptdir/mirrorlist/mirror_list.pl
9 masterlist=$scriptdir/mirrorlist/Mirrors.masterlist
10
11 test ! -f $HOME/.cvspass && \
12         echo ":pserver:anonymous@cvs.debian.org:/cvs/webwml A" > $HOME/.cvspass
13 grep -q "cvs.debian.org:/cvs/webwml" ~/.cvspass || \
14         echo ":pserver:anonymous@cvs.debian.org:/cvs/webwml A" >> $HOME/.cvspass
15
16 cd $(dirname $masterlist)
17 cvs update
18
19 if [ ! -f $ftpdir/README.mirrors.html -o $masterlist -nt $ftpdir/README.mirrors.html ] ; then
20         rm -f $ftpdir/README.mirrors.html $ftpdir/README.mirrors.txt
21         $prog -m $masterlist -t html > $ftpdir/README.mirrors.html
22         $prog -m $masterlist -t text > $ftpdir/README.mirrors.txt
23         if [ ! -f $ftpdir/README.non-US -o $masterlist -nt $ftpdir/README.non-US ] ; then
24                 rm -f $ftpdir/README.non-US
25                 $prog -m $masterlist -t nonus > $ftpdir/README.non-US
26                 install -m 664 $ftpdir/README.non-US $webdir
27         fi
28         echo Updated archive version of mirrors file
29 fi