diff options
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 7d18d86c4ea..b0a5055faa8 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -166,6 +166,7 @@ BEGIN { &merge_into &give_ctan_mirror &give_ctan_mirror_base + &create_mirror_list &tlmd5 &xsystem &run_cmd @@ -3426,6 +3427,41 @@ sub give_ctan_mirror return (give_ctan_mirror_base(@_) . "/$TeXLiveServerPath"); } +=item C<create_mirror_list()> + +Returns the lists of viable mirrors according to mirrors.pl, in +a list which also contains continents, and country headers. + +=cut + +sub create_mirror_list { + our $mirrors; + my @ret = (); + require("installer/mirrors.pl"); + my @continents = sort keys %$mirrors; + for my $continent (@continents) { + # first push the name of the continent + push @ret, uc($continent); + my @countries = sort keys %{$mirrors->{$continent}}; + for my $country (@countries) { + my @mirrors = sort keys %{$mirrors->{$continent}{$country}}; + my $first = 1; + for my $mirror (@mirrors) { + my $mfull = $mirror; + $mfull =~ s!/$!!; + $mfull .= "/" . $TeXLive::TLConfig::TeXLiveServerPath; + #if ($first) { + push @ret, " $country $mfull"; + # $first = 0; + #} else { + # push @ret, " $mfull"; + #} + } + } + } + return @ret; +} + sub tlmd5 { my ($file) = @_; if (-r $file) { |