From cd8bd9150225fd603f3d1a3c70914668b0d01866 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 19 Apr 2013 16:02:35 +0000 Subject: msg tweaking in case of wget fallback git-svn-id: svn://tug.org/texlive/trunk@30038 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLDownload.pm | 2 +- 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); } -- cgit v1.2.3