diff options
author | Norbert Preining <preining@logic.at> | 2010-12-21 04:35:03 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2010-12-21 04:35:03 +0000 |
commit | 7ae46977d3ab035482a18fa613ac8cbf81ebc258 (patch) | |
tree | d6ea2712730e7ce62924a538ebd4f0b7b6b0697e /Master/tlpkg/TeXLive | |
parent | cf87eda53b8c47662a4db2c61a8a42085201b370 (diff) |
TLUtils: when quering mirror.ctan.org set LC_ALL to C to get english strings
git-svn-id: svn://tug.org/texlive/trunk@20818 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 61e922cc244..777e4d97e71 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -3179,6 +3179,14 @@ sub query_ctan_mirror my $cmd = "$wget $mirror --timeout=60 -O " . (win32() ? "nul" : "/dev/null") . " 2>&1"; + # + # since we are reading the output of wget to find a mirror + # we have to make sure that the locale is unset + my $saved_lcall; + if (defined($ENV{'LC_ALL'})) { + $saved_lcall = $ENV{'LC_ALL'}; + } + $ENV{'LC_ALL'} = "C"; # we try 3 times to get a mirror from mirror.ctan.org in case we have # bad luck with what gets returned. my $max_trial = 3; @@ -3195,6 +3203,13 @@ sub query_ctan_mirror sleep(1); } + # reset LC_ALL to undefined or the previous value + if (defined($saved_lcall)) { + $ENV{'LC_ALL'} = $saved_lcall; + } else { + delete($ENV{'LC_ALL'}); + } + # we are still here, so three times we didn't get a mirror, give up # and return undefined return; |