summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-12-17 00:00:43 +0000
committerKarl Berry <karl@freefriends.org>2012-12-17 00:00:43 +0000
commitde9c3324abc72a20c297809807eca886e44e7426 (patch)
tree6bbfb070d7dedc0cc515412b4134ef6c82178d64 /Master
parent639e1fdbc41e35a713fd2ab2b79e98daa1dde8ff (diff)
parse CTAN.sites, not the fancy new html appearing at http://ctan.org/mirrors
git-svn-id: svn://tug.org/texlive/trunk@28555 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/tlpkg/bin/tl-update-auto2
-rwxr-xr-xMaster/tlpkg/bin/tl-update-ctan-mirrors17
-rw-r--r--Master/tlpkg/installer/ctan-mirrors.pl160
3 files changed, 171 insertions, 8 deletions
diff --git a/Master/tlpkg/bin/tl-update-auto b/Master/tlpkg/bin/tl-update-auto
index c4c15205dd5..9bab2560fff 100755
--- a/Master/tlpkg/bin/tl-update-auto
+++ b/Master/tlpkg/bin/tl-update-auto
@@ -259,7 +259,7 @@ if test `date +%w` = 0; then # only update on Sundays
ctan_mirmon=$TMPDIR/mirmon.state
mirrors4tl=tlpkg/installer/ctan-mirrors.pl # massaged for TL
- if wget --quiet http://ctan.org/mirrors -O $ctan_mirrors \
+ if wget --quiet http://ctan.org/tex-archive/CTAN.sites -O $ctan_mirrors \
&& rsync rsync://comedy.dante.de/MirMon/mirmon.state $ctan_mirmon; then
$mydir/tl-update-ctan-mirrors $ctan_mirrors $ctan_mirmon >$mirrors4tl.new
if $diff $mirrors4tl $mirrors4tl.new; then
diff --git a/Master/tlpkg/bin/tl-update-ctan-mirrors b/Master/tlpkg/bin/tl-update-ctan-mirrors
index 01c64bd4ac2..bf1d0e2c96f 100755
--- a/Master/tlpkg/bin/tl-update-ctan-mirrors
+++ b/Master/tlpkg/bin/tl-update-ctan-mirrors
@@ -33,10 +33,10 @@ sub main {
# Return hash of good and bad urls from mirmon state data.
#
sub read_mstate {
- my ($MSTATE) = @_;
+ my ($mstate) = @_;
my %good_urls;
- open (MSTATE, "<$MSTATE") || die "$0: open($MSTATE) failed: $!\n";
+ open (MSTATE, "<$mstate") || die "$0: open($mstate) failed: $!\n";
while (<MSTATE>) {
my ($m, $age, $status_last_probe, $time_last_succesful_probe,
$probe_history, $state_history, $last_probe)
@@ -49,6 +49,7 @@ sub read_mstate {
}
close(MSTATE);
+ die "no good urls found in ctan mirmon: $mstate" if keys %good_urls == 0;
return %good_urls;
}
@@ -56,15 +57,17 @@ sub read_mstate {
# return hash of CTAN.sites info.
#
sub read_readme_mirror {
- my ($CTAN_SITES,$good_urls_ref) = @_;
+ my ($ctan_sites,$good_urls_ref) = @_;
my %mirrors;
my ($continent, $country, $mirror, %protocols);
- open (CTAN_SITES,"<$CTAN_SITES") || die "$0: open($CTAN_SITES) failed: $!\n";
+ open (CTAN_SITES,"<$ctan_sites") || die "$0: open($ctan_sites) failed: $!\n";
while (<CTAN_SITES>) {
chomp;
- if (m/^ (Africa|Asia|Australasia|Europe|North America|South America)/) {
+ if (m/^ (Africa|Asia|Australasia|Europe|North America|South America)/) {
+# if (m/>(Africa|Asia|Australasia|Europe|North America|South America)</) {
my $save_continent = $1;
+ #warn "got continent $save_continent\n";
if (defined($mirror)) {
for my $p (keys %protocols) {
add_mirror(\%mirrors,$continent,$country,$mirror,$p,$protocols{$p},
@@ -101,8 +104,10 @@ sub read_readme_mirror {
$protocols{$1} = "$2/$3";
next;
}
- #print "ignored >>$_<<\n";
+ #warn "ignored >>$_<<\n";
}
+
+ die "no ctan mirrors found in $ctan_sites" if keys %mirrors == 0;
return %mirrors;
}
diff --git a/Master/tlpkg/installer/ctan-mirrors.pl b/Master/tlpkg/installer/ctan-mirrors.pl
index fac256e9091..29c2d846473 100644
--- a/Master/tlpkg/installer/ctan-mirrors.pl
+++ b/Master/tlpkg/installer/ctan-mirrors.pl
@@ -1 +1,159 @@
-$mirrors = {};
+$mirrors = {
+ 'Africa' => {
+ 'South Africa' => {
+ 'http://ctan.mirror.ac.za/' => 1,
+ 'http://ftp.leg.uct.ac.za/pub/packages/ctan/' => 1
+ }
+ },
+ 'Asia' => {
+ 'China' => {
+ 'http://ftp.ctex.org/mirrors/CTAN/' => 1,
+ 'http://mirror.bjtu.edu.cn/CTAN/' => 1,
+ 'http://mirror.neu.edu.cn/CTAN/' => 1,
+ 'http://mirrors.ustc.edu.cn/CTAN/' => 1,
+ 'http://mirrors.xmu.edu.cn/CTAN/' => 1
+ },
+ 'India' => {
+ 'http://ctan.imsc.res.in/' => 1
+ },
+ 'Indonesia' => {
+ 'http://kambing.ui.ac.id/ctan/' => 1
+ },
+ 'Iran' => {
+ 'http://ctan.um.ac.ir/' => 1,
+ 'http://ctan.yazd.ac.ir/' => 1,
+ 'http://ctan.yazduni.ac.ir/' => 1
+ },
+ 'Japan' => {
+ 'http://ftp.jaist.ac.jp/pub/CTAN/' => 1
+ },
+ 'Korea' => {
+ 'http://ftp.kaist.ac.kr/pub/tex-archive/' => 1,
+ 'http://ftp.neowiz.com/CTAN/' => 1
+ },
+ 'Pakistan' => {
+ 'http://mirror-cybernet.lums.edu.pk/pub/ctan/' => 1,
+ 'http://stingray.cyber.net.pk/pub/ctan/' => 1
+ },
+ 'Singapore' => {
+ 'http://download.nus.edu.sg/mirror/CTAN/' => 1
+ },
+ 'Taiwan' => {
+ 'http://ctan.cdpa.nsysu.edu.tw/' => 1,
+ 'http://shadow.ind.ntou.edu.tw/ctan/' => 1
+ },
+ 'Thailand' => {
+ 'http://ctan.megagod.net/tex-archive/' => 1
+ }
+ },
+ 'Australasia' => {
+ 'Australia' => {
+ 'http://ctan.unsw.edu.au/' => 1
+ },
+ 'New Zealand' => {
+ 'http://elena.aut.ac.nz/ctan/' => 1
+ }
+ },
+ 'Europe' => {
+ 'Czech Republic' => {
+ 'http://ftp.cvut.cz/tex-archive/' => 1
+ },
+ 'Denmark' => {
+ 'http://mirrors.dotsrc.org/ctan/' => 1
+ },
+ 'France' => {
+ 'http://ctan.mines-albi.fr/' => 1,
+ 'http://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/ctan/' => 1,
+ 'http://ftp.oleane.net/pub/CTAN/' => 1,
+ 'http://mirror.ibcp.fr/pub/CTAN/' => 1,
+ 'http://mirrors.ircam.fr/pub/CTAN/' => 1,
+ 'http://mirrors.linsrv.net/tex-archive/' => 1
+ },
+ 'Germany' => {
+ 'ftp://ftp.rrzn.uni-hannover.de/pub/mirror/tex-archive/' => 1,
+ 'http://ftp.uni-erlangen.de/mirrors/CTAN/' => 1,
+ 'http://mirror.informatik.uni-mannheim.de/pub/mirrors/tex-archive/' => 1,
+ 'http://sunsite.informatik.rwth-aachen.de/ftp/pub/mirror/ctan/' => 1
+ },
+ 'Greece' => {
+ 'http://ftp.cc.uoc.gr/mirrors/CTAN/' => 1
+ },
+ 'Italy' => {
+ 'http://ctan.mirror.garr.it/mirrors/CTAN/' => 1,
+ 'http://ftp.uniRoma2.it/TeX/' => 1
+ },
+ 'Lithuania' => {
+ 'http://ctan.vgtu.lt/' => 1
+ },
+ 'Netherlands' => {
+ 'http://ftp.snt.utwente.nl/pub/software/tex/' => 1
+ },
+ 'Norway' => {
+ 'http://ctan.uib.no/' => 1
+ },
+ 'Poland' => {
+ 'ftp://ftp.tpnet.pl/pub/CTAN/' => 1
+ },
+ 'Portugal' => {
+ 'http://ftp.eq.uc.pt/software/TeX/' => 1
+ },
+ 'Russia' => {
+ 'http://ctan.uni-altai.ru/' => 1,
+ 'http://ctan.usu.ru/' => 1,
+ 'http://mirror.macomnet.net/pub/CTAN/' => 1,
+ 'http://mirrors.nlab.su/ctan/' => 1
+ },
+ 'Slovenia' => {
+ 'http://ctan.ijs.si/tex-archive/' => 1
+ },
+ 'Spain' => {
+ 'http://osl.ugr.es/CTAN/' => 1
+ },
+ 'UK' => {
+ 'http://anorien.csc.warwick.ac.uk/mirrors/CTAN/' => 1
+ }
+ },
+ 'North America' => {
+ 'Canada' => {
+ 'http://ctan.mirror.rafal.ca/' => 1,
+ 'http://mirror.csclub.uwaterloo.ca/CTAN/' => 1,
+ 'http://mirror.its.dal.ca/ctan/' => 1
+ },
+ 'Costa Rica' => {
+ 'http://mirrors.ucr.ac.cr/CTAN/' => 1
+ },
+ 'Mexico' => {
+ 'http://tezcatl.fciencias.unam.mx/tex-archive/' => 1
+ },
+ 'USA' => {
+ 'http://ctan.gladstone-tech.com/' => 1,
+ 'http://ctan.mackichan.com/' => 1,
+ 'http://ctan.math.utah.edu/ctan/tex-archive/' => 1,
+ 'http://ctan.mirrorcatalogs.com/' => 1,
+ 'http://ctan.mirrors.hoobly.com/' => 1,
+ 'http://ctan.unixbrain.com/' => 1,
+ 'http://get-software.net/' => 1,
+ 'http://mirror.hmc.edu/ctan/' => 1,
+ 'http://mirror.jmu.edu/pub/CTAN/' => 1,
+ 'http://mirror.math.ku.edu/tex-archive/' => 1,
+ 'http://mirror.unl.edu/ctan/' => 1,
+ 'http://mirror.utexas.edu/ctan/' => 1,
+ 'http://mirrors.ibiblio.org/pub/mirrors/CTAN/' => 1,
+ 'http://mirrors.med.harvard.edu/ctan/' => 1,
+ 'http://mirrors.rit.edu/CTAN/' => 1,
+ 'http://www.math.washington.edu/tex-archive/' => 1
+ }
+ },
+ 'South America' => {
+ 'Brazil' => {
+ 'http://ctan.tche.br/' => 1,
+ 'http://linorg.usp.br/CTAN/' => 1
+ },
+ 'Chile' => {
+ 'ftp://ftp.inf.utfsm.cl/pub/tex-archive/' => 1
+ },
+ 'Colombia' => {
+ 'http://www.laqee.unal.edu.co/tex-archive/' => 1
+ }
+ }
+};