diff options
author | Karl Berry <karl@freefriends.org> | 2008-07-02 23:52:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-07-02 23:52:46 +0000 |
commit | 376383f4310b2ff3811d2e933f956ee7ca54df12 (patch) | |
tree | f1a989817f0c48ae78d80466fcabad8ef955264f /Master/tlpkg/TeXLive/TLUtils.pm | |
parent | b56e66944a70a65ebf75d3757350058caab1d0e3 (diff) |
use TLConfig values for default locations instead of hardwiring
git-svn-id: svn://tug.org/texlive/trunk@9178 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 59ab8bd92d8..db267c05e36 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -1453,29 +1453,28 @@ sub conv_to_win_path { } -sub give_ctan_mirror { - my $originalurl = "http://mirror.ctan.org"; +sub give_ctan_mirror +{ my $wget = $::progs{'wget'}; - if (!defined($wget)) { - tlwarn("programs not set up, trying wget\n"); + if (!defined ($wget)) { + tlwarn ("programs not set up, trying wget\n"); $wget = "wget"; } - if (win32()) { - $cmd = "$wget http://mirror.ctan.org -O nul 2>&1"; - } else { - $cmd = "$wget http://mirror.ctan.org -O /dev/null 2>&1"; - } + + my $cmd = "$wget $TeXLiveServerURL -O " + . (win32() ? "nul" : "/dev/null") . " 2>&1"; my @out = `$cmd`; # now analyze the output - my $mirror = "http://mirror.ctan.org/systems/texlive/tlnet/tldev/"; + my $mirror = $TeXLiveURL; foreach (@out) { if (m/^Location: (\S*)\s*.*$/) { - $mirror = "$1" . "/systems/texlive/tlnet/tldev"; + (my $mhost = $1) =~ s,/*$,,; # remove trailing slashes since we add it: + $mirror = "$mhost/$TeXLiveServerPath"; last; } } - # if we cannot find a mirror, return the mirror.ctan.org itself - return($mirror); + # if we cannot find a mirror, return the default (mirror.ctan.org) itself + return $mirror; } sub tlmd5 { |