diff options
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLDownload.pm | 2 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/Master/tlpkg/TeXLive/TLDownload.pm b/Master/tlpkg/TeXLive/TLDownload.pm index d1528d89768..0eb24f84357 100644 --- a/Master/tlpkg/TeXLive/TLDownload.pm +++ b/Master/tlpkg/TeXLive/TLDownload.pm @@ -28,7 +28,7 @@ my $MAX_ERRORCOUNT = 5; our $net_lib_avail = 0; eval { require LWP; }; if ($@) { - debug("LWP is not available, falling back to wget mode.\n"); + debug("LWP is not available, falling back to wget.\n"); $net_lib_avail = 0; } else { require LWP::UserAgent; diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index a989afb9e6f..825f6daf56a 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -2494,6 +2494,8 @@ sub download_file { } else { $url = "$TeXLiveURL/$relpath"; } + + my $wget_retry = 0; if (defined($::tldownload_server) && $::tldownload_server->enabled) { debug("persistent connection set up, trying to get $url (for $dest)\n"); $ret = $::tldownload_server->get_file($url, $dest); @@ -2501,8 +2503,10 @@ sub download_file { debug("downloading file via persistent connection succeeded\n"); return $ret; } else { - tlwarn("tlmgr: persistent connection ok, but download failed: $url\n"); - tlwarn("tlmgr: retrying with wget.\n"); + tlwarn("TLUtils::download_file: persistent connection ok," + . " but download failed: $url\n"); + tlwarn("TLUtils::download_file: retrying with wget.\n"); + $wget_retry = 1; # just so we can give another msg. } } else { if (!defined($::tldownload_server)) { @@ -2512,7 +2516,15 @@ sub download_file { } debug("persistent connection not set up, using wget\n"); } + + # try again. my $ret = _download_file($url, $dest, $wget); + + if ($wget_retry) { + tlwarn("TLUtils::download_file: retry with wget " + . ($ret ? "succeeded" : "failed") . ": $url\n"); + } + return($ret); } |