From a76e10d09c8cfe7d7586ff8ca2f0e35ab11c7d5a Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 23 Jul 2009 22:22:57 +0000 Subject: make sure that we do not replace a full path given with mirror.ctan.org with our fixed tlnet location, but replace only the initial mirror.ctan.org with a mirror git-svn-id: svn://tug.org/texlive/trunk@14415 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'Master/tlpkg/TeXLive') diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index d69a608db28..cacf1bf71c1 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -75,7 +75,8 @@ C -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::merge_into(\%to, \%from); TeXLive::TLUtils::texdir_check($texdir); TeXLive::TLUtils::conv_to_w32_path($path); - TeXLive::TLUtils::give_ctan_mirror($path); + TeXLive::TLUtils::give_ctan_mirror(); + TeXLive::TLUtils::give_ctan_mirror_base(); TeXLive::TLUtils::tlmd5($path); =head1 DESCRIPTION @@ -124,6 +125,7 @@ BEGIN { &welcome &welcome_paths &give_ctan_mirror + &give_ctan_mirror_base &tlmd5 &xsystem &run_cmd @@ -2899,6 +2901,8 @@ sub conv_to_w32_path { =item C +=item C + Return the specific mirror chosen from the generic CTAN auto-redirecting default (specified in L<$TLConfig::TexLiveServerURL>) if possible, else the default url again. @@ -2907,9 +2911,13 @@ Neither C nor is honored (see L), since certain options have to be set to do the job and the program has to be C since we parse the output. +The B<_base> variant returns the mirror without any TeX Live specific +location added while the other variant gives the location of the +TeX Live net distribution on the respective mirror. + =cut -sub give_ctan_mirror +sub give_ctan_mirror_base { my $wget = $::progs{'wget'}; if (!defined ($wget)) { @@ -2927,7 +2935,7 @@ sub give_ctan_mirror foreach (@out) { if (m/^Location: (\S*)\s*.*$/) { (my $mhost = $1) =~ s,/*$,,; # remove trailing slashes since we add it - $mirror = "$mhost/$TeXLiveServerPath"; + $mirror = "$mhost"; last; } } @@ -2935,6 +2943,11 @@ sub give_ctan_mirror return $mirror; } +sub give_ctan_mirror +{ + return (give_ctan_mirror_base() . "$TeXLiveServerPath"); +} + sub tlmd5 { my ($file) = @_; if (-r $file) { -- cgit v1.2.3