summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-02-22 03:01:54 +0000
committerNorbert Preining <norbert@preining.info>2021-02-22 03:01:54 +0000
commit1c74c0d7614ec471bea05b5919b68e67a05dd6c1 (patch)
tree8631538e81cccc6ba01275553fc571cb4d02e349 /systems/texlive/tlnet/tlpkg/TeXLive
parentf35565737733e319e7293a9fafe1b78e87f8a14e (diff)
CTAN sync 202102220301
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/TeXLive')
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm31
1 files changed, 23 insertions, 8 deletions
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm
index e0bad45461..5d0f8490d1 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm
@@ -1,6 +1,6 @@
-# $Id: TLDownload.pm 54993 2020-05-03 21:57:54Z karl $
+# $Id: TLDownload.pm 57809 2021-02-20 21:55:13Z karl $
# TeXLive::TLDownload.pm - module for abstracting the download modes
-# Copyright 2009-2020 Norbert Preining
+# Copyright 2009-2021 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
@@ -9,7 +9,7 @@ package TeXLive::TLDownload;
use TeXLive::TLUtils;
use TeXLive::TLConfig;
-my $svnrev = '$Revision: 54993 $';
+my $svnrev = '$Revision: 57809 $';
my $_modulerevision;
if ($svnrev =~ m/: ([0-9]+) /) {
$_modulerevision = $1;
@@ -48,23 +48,38 @@ sub new
-sub reinit
-{
+sub reinit {
my $self = shift;
+
+ # Irritatingly, as of around version 6.52, when env_proxy is set, LWP
+ # started unconditionally complaining if the environment contains
+ # differing case-insensitive like foo=1 and FOO=2. Even on systems
+ # that have case-sensitive environments, and even about variables that
+ # have nothing whatsoever to do with LWP (like foo).
+ #
+ # So, only pass env_proxy=>1 when creating the UserAgent if there are
+ # in fact *_proxy variables (case-insensitive, just in case) set in
+ # the environment.
+ #
+ my @env_proxy = ();
+ if (grep { /_proxy/i } keys %ENV ) {
+ @env_proxy = ("env_proxy", 1);
+ }
+ #
my $ua = LWP::UserAgent->new(
agent => "texlive/lwp",
# use LWP::ConnCache, and keep 1 connection open
keep_alive => 1,
- env_proxy => 1,
timeout => $TeXLive::TLConfig::NetworkTimeout,
+ @env_proxy,
);
$self->{'ua'} = $ua;
$self->{'enabled'} = 1;
$self->{'errorcount'} = 0;
$self->{'initcount'} += 1;
}
-sub enabled
-{
+
+sub enabled {
my $self = shift;
return $self->{'enabled'};
}