summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-update-ctan-mirrors
diff options
context:
space:
mode:
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;
}