Skip to content

Commit

Permalink
updating installer data
Browse files Browse the repository at this point in the history
  • Loading branch information
norbusan committed Jan 7, 2024
1 parent 54995ca commit 8f109d0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
4 changes: 3 additions & 1 deletion install-tl
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,9 @@ sub final_remote_init {
} elsif ($media eq "NET") {
info("Distribution: net (downloading)\n");
info("Using URL: $TeXLiveURL\n");
TeXLive::TLUtils::setup_persistent_downloads() if $opt_persistent_downloads;
TeXLive::TLUtils::setup_persistent_downloads(
"$::installerdir/tlpkg/installer/curl/curl-ca-bundle.crt"
) if $opt_persistent_downloads;
} else {
info("Distribution: $media\n");
}
Expand Down
4 changes: 3 additions & 1 deletion texmf-dist/scripts/texlive/tlmgr.pl
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,9 @@ sub main {
# if we are asked to use persistent connections try to start it here
ddebug("tlmgr:main: do persistent downloads = $opts{'persistent-downloads'}\n");
if ($opts{'persistent-downloads'}) {
TeXLive::TLUtils::setup_persistent_downloads() ;
TeXLive::TLUtils::setup_persistent_downloads(
"$Master/tlpkg/installer/curl/curl-ca-bundle.crt"
) ;
}
if (!defined($::tldownload_server)) {
debug("tlmgr:main: ::tldownload_server not defined\n");
Expand Down
12 changes: 11 additions & 1 deletion tlpkg/TeXLive/TLDownload.pm
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ if ($@) {
sub new
{
my $class = shift;
my %params = @_;
my $self = {};
$self->{'initcount'} = 0;
bless $self, $class;
$self->reinit();
$self->reinit(defined($params{'certificates'}) ? $params{'certificates'} : "");
return $self;
}

Expand All @@ -52,6 +53,7 @@ sub new

sub reinit {
my $self = shift;
my $certs = shift;

# Irritatingly, as of around version 6.52, when env_proxy is set, LWP
# started unconditionally complaining if the environment contains
Expand All @@ -68,6 +70,14 @@ sub reinit {
@env_proxy = ("env_proxy", 1);
}
#
# Set HTTPS_CA_FILE to the TL provided certificate bundle
# for systems that don't have a system-wide certificate bundle
# in particular MacOS.
if ((! exists $ENV{'HTTPS_CA_FILE'}) && $certs) {
debug("Setting env var HTTPS_CA_FILE to " . $certs ."\n");
$ENV{'HTTPS_CA_FILE'} = $certs
}
#
my $ua = LWP::UserAgent->new(
agent => "texlive/lwp",
# use LWP::ConnCache, and keep 1 connection open
Expand Down
5 changes: 3 additions & 2 deletions tlpkg/TeXLive/TLUtils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4229,17 +4229,18 @@ false.
=cut

sub setup_persistent_downloads {
my $certs = shift;
if ($TeXLive::TLDownload::net_lib_avail) {
ddebug("setup_persistent_downloads has net_lib_avail set\n");
if ($::tldownload_server) {
if ($::tldownload_server->initcount() > $TeXLive::TLConfig::MaxLWPReinitCount) {
debug("stop retrying to initialize LWP after 10 failures\n");
return 0;
} else {
$::tldownload_server->reinit();
$::tldownload_server->reinit(certificates => $certs);
}
} else {
$::tldownload_server = TeXLive::TLDownload->new;
$::tldownload_server = TeXLive::TLDownload->new(certificates => $certs);
}
if (!defined($::tldownload_server)) {
ddebug("TLUtils:setup_persistent_downloads: failed to get ::tldownload_server\n");
Expand Down

0 comments on commit 8f109d0

Please sign in to comment.