summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-update-ctan-mirrors
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/tlpkg/bin/tl-update-ctan-mirrors
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/tlpkg/bin/tl-update-ctan-mirrors')
-rwxr-xr-xMaster/tlpkg/bin/tl-update-ctan-mirrors17
1 files changed, 11 insertions, 6 deletions
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;
}