diff options
author | Norbert Preining <preining@logic.at> | 2009-12-16 07:06:01 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-12-16 07:06:01 +0000 |
commit | 7a3ba3138290c49da244552d62e88a08b2d14e78 (patch) | |
tree | ed48216d1a7539d48f0eb44ca9f2bd08fbd0f51c /Master/tlpkg/TeXLive/TLUtils.pm | |
parent | 1501e3ba218f0698b94682df440b76ff94d64606 (diff) |
implement --persistent-downloads using LWP
git-svn-id: svn://tug.org/texlive/trunk@16424 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 0812af55609..6dc3022ece9 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -79,6 +79,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::remove_symlinks($root, $arch, $sys_bin, $sys_man, $sys_info); TeXLive::TLUtils::w32_add_to_path($bindir, $multiuser); TeXLive::TLUtils::w32_remove_from_path($bindir, $multiuser); + TeXLive::TLUtils::setup_persistent_downloads(); =head2 Miscellaneous @@ -156,6 +157,7 @@ BEGIN { &compare_tlpobjs &compare_tlpdbs &report_tlpdb_differences + &setup_persistent_downloads ); @EXPORT = qw(setup_programs download_file process_logging_options tldie tlwarn info log debug ddebug dddebug debug_hash @@ -168,6 +170,7 @@ use Getopt::Long; use File::Temp; use TeXLive::TLConfig; + $::opt_verbosity = 0; # see process_logging_options @@ -2226,10 +2229,10 @@ sub download_file { } else { $url = "$TeXLiveURL/$relpath"; } - if (defined($::current_server)) { - if ($::current_server->get_file($url, $dest)) { + if (defined($::tldownload_server)) { + if (($ret = $::tldownload_server->get_file($url, $dest))) { debug("downloading file via permanent connection succeeded\n"); - return 1; + return $ret; } else { tlwarn("permanent server connection set up, but downloading did not succeed!"); tlwarn("Retrying with wget.\n"); @@ -2993,6 +2996,20 @@ sub conv_to_w32_path { return($p); } +=item C<setup_persistent_downloads()> + +Setup the system to use persistent connections using LWP/TLDownload. + +=cut + +sub setup_persistent_downloads +{ + if (!$TeXLive::TLDownload::net_lib_avail) { + tlwarn("Cannot set up persistent connections, LWP is missing.\n"); + return 0; + } + return ($::tldownload_server = TeXLive::TLDownload->new); +} =item C<give_ctan_mirror()> |