summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-07-23 22:22:57 +0000
committerNorbert Preining <preining@logic.at>2009-07-23 22:22:57 +0000
commita76e10d09c8cfe7d7586ff8ca2f0e35ab11c7d5a (patch)
tree1e50f75014e4cae3c8a9ee52e96a5936db963e43 /Master/tlpkg/TeXLive
parentb3fbe286e0b43f9781c4fd3279972ab5eceaae47 (diff)
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
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm19
1 files changed, 16 insertions, 3 deletions
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<TeXLive::TLUtils> -- 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<give_ctan_mirror()>
+=item C<give_ctan_mirror_base()>
+
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<TL_DOWNLOAD_PROGRAM> nor <TL_DOWNLOAD_ARGS> is honored (see
L<download_file>), since certain options have to be set to do the job
and the program has to be C<wget> 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) {