diff options
author | Norbert Preining <preining@logic.at> | 2010-11-09 08:33:14 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2010-11-09 08:33:14 +0000 |
commit | ac9dbf97d63c852cd237c8c5a29d98f15ca1135a (patch) | |
tree | a95dcb5689ef50b09c96b85267c1486151e4b6d7 /Master/tlpkg/TeXLive | |
parent | 120b79f76077350f6de08ffc9a0c51c88090a32c (diff) |
fix persistent download setup in tlmgr -- thanks Adam!
add some debugging to the persistent download routines
git-svn-id: svn://tug.org/texlive/trunk@20379 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLDownload.pm | 8 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 17 |
2 files changed, 20 insertions, 5 deletions
diff --git a/Master/tlpkg/TeXLive/TLDownload.pm b/Master/tlpkg/TeXLive/TLDownload.pm index 27370da4855..81c1bebb87a 100644 --- a/Master/tlpkg/TeXLive/TLDownload.pm +++ b/Master/tlpkg/TeXLive/TLDownload.pm @@ -59,24 +59,24 @@ sub new sub enabled { my $self = shift; - return $self{'enabled'}; + return $self->{'enabled'}; } sub disabled { my $self = shift; - return (!$self{'enabled'}); + return (!$self->{'enabled'}); } sub enable { my $self = shift; - $self{'enabled'} = 1; + $self->{'enabled'} = 1; # also reset the error conter $self->reset_errorcount; } sub disable { my $self = shift; - $self{'enabled'} = 0; + $self->{'enabled'} = 0; } sub errorcount { diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 5b56d107b4a..61e922cc244 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -2274,6 +2274,7 @@ sub download_file { $url = "$TeXLiveURL/$relpath"; } if (defined($::tldownload_server) && $::tldownload_server->enabled) { + debug("persistent connection set up, trying to get file.\n"); if (($ret = $::tldownload_server->get_file($url, $dest))) { debug("downloading file via permanent connection succeeded\n"); return $ret; @@ -2281,6 +2282,13 @@ sub download_file { tlwarn("permanent server connection set up, but downloading did not succeed!"); tlwarn("Retrying with wget.\n"); } + } else { + if (!defined($::tldownload_server)) { + debug("::tldownload_server not defined\n"); + } else { + debug("::tldownload_server->enabled is not set\n"); + } + debug("persistent connection not set up, using wget\n"); } my $ret = _download_file($url, $dest, $wget); return($ret); @@ -3132,7 +3140,14 @@ Set up to use persistent connections using LWP/TLDownload. sub setup_persistent_downloads { if ($TeXLive::TLDownload::net_lib_avail) { - return ($::tldownload_server = TeXLive::TLDownload->new); + debug("setting up persistent downloads succeeded!\n"); + $::tldownload_server = TeXLive::TLDownload->new; + if (!defined($::tldownload_server)) { + debug("TLUtils:setup_persistent_downloads: ::tldownload_server undefined\n"); + } else { + debug("TLUtils:setup_persistent_downloads: succeeded in getting ::tldownload_server\n"); + } + return ($::tldownload_server); } return 0; } |