summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-04-11 03:09:12 +0000
committerNorbert Preining <norbert@preining.info>2020-04-11 03:09:12 +0000
commitc2697fc286a1e2c94fd9968b76be6f4a6d2114cd (patch)
tree1dc2cfb07cb032740483dd8be7c74aff66b70352 /systems/texlive/tlnet/tlpkg/TeXLive
parent25111608e6aa05042b0c6f83009262e1973d7a45 (diff)
CTAN sync 202004110309
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/TeXLive')
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLConfig.pm18
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm13
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm32
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm30
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLPSRC.pm25
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLTREE.pm10
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm108
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLWinGoo.pm21
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TeXCatalogue.pm41
9 files changed, 205 insertions, 93 deletions
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLConfig.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLConfig.pm
index f9361b9e72..0f3e70bfc0 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLConfig.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLConfig.pm
@@ -1,4 +1,4 @@
-# $Id: TLConfig.pm 53977 2020-02-29 23:16:52Z karl $
+# $Id: TLConfig.pm 54123 2020-03-06 00:59:56Z preining $
# TeXLive::TLConfig.pm - module exporting configuration values
# Copyright 2007-2020 Norbert Preining
# This file is licensed under the GNU General Public License version 2
@@ -6,7 +6,7 @@
package TeXLive::TLConfig;
-my $svnrev = '$Revision: 53977 $';
+my $svnrev = '$Revision: 54123 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -46,6 +46,8 @@ BEGIN {
%TLPDBSettings
%TLPDBConfigs
$NetworkTimeout
+ $MaxLWPErrors
+ $MaxLWPReinitCount
$PartialEngineSupport
$F_OK $F_WARNING $F_ERROR $F_NOPOSTACTION
$ChecksumLength
@@ -57,11 +59,11 @@ BEGIN {
# the year of our release, will be used in the location of the
# network packages, and in menu names, and other places.
-$ReleaseYear = 2019;
+$ReleaseYear = 2020;
# users can upgrade from this year to the current year; might be the
# same as the release year, or any number of releases earlier.
-# Generally not tested.
+# Generally not tested, but should be.
$MinRelease = 2016;
# Meta Categories do not ship files, but only call for other packages.
@@ -93,6 +95,10 @@ our $BlockSize = 4096;
# timeout for network connections (wget, LWP) in seconds
our $NetworkTimeout = 30;
+# number of errors during an LWP session until it is marked as disabled
+our $MaxLWPErrors = 5;
+# max number of times we reenable LWP after it was disabled
+our $MaxLWPReinitCount = 10;
our $Archive = "archive";
our $TeXLiveServerURL = "http://mirror.ctan.org";
@@ -161,7 +167,7 @@ our %TLPDBConfigs = (
"container_format" => $DefaultCompressorFormat,
"minrelease" => $MinRelease,
"release" => $ReleaseYear,
- "frozen" => 1,
+ "frozen" => 0,
);
# definition of the option strings and their value types
@@ -236,7 +242,7 @@ our %TLPDBSettings = (
our $WindowsMainMenuName = "TeX Live $ReleaseYear";
# Comma-separated list of engines which do not exist on all platforms.
-our $PartialEngineSupport = "luahbtex,luajittex,mfluajit";
+our $PartialEngineSupport = "luajithbtex,luajittex,mfluajit";
# Flags for error handling across the scripts and modules
# all fine
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm
index fbd7d1c7a4..5ce0e3632e 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm
@@ -1,4 +1,4 @@
-# $Id: TLCrypto.pm 53853 2020-02-21 08:39:42Z preining $
+# $Id: TLCrypto.pm 54064 2020-03-04 01:25:36Z preining $
# TeXLive::TLCrypto.pm - handle checksums and signatures.
# Copyright 2016-2020 Norbert Preining
# This file is licensed under the GNU General Public License version 2
@@ -12,7 +12,7 @@ use TeXLive::TLConfig;
use TeXLive::TLUtils qw(debug ddebug win32 which platform
conv_to_w32_path tlwarn tldie);
-my $svnrev = '$Revision: 53853 $';
+my $svnrev = '$Revision: 54064 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -595,9 +595,12 @@ sub gpg_verify_signature {
debug("verification succeeded, output:\n$out\n");
return ($VS_VERIFIED, $out);
} else {
- if (grep(/^\[GNUPG:\] NO_PUBKEY (.*)/, @status_lines)) {
- debug("missing pubkey $1\n");
- return ($VS_PUBKEY_MISSING, "missing pubkey $1");
+ my @nopb = grep(/^\[GNUPG:\] NO_PUBKEY /, @status_lines);
+ if (@nopb) {
+ my $mpk = $nopb[-1];
+ $mpk =~ s/^\[GNUPG:\] NO_PUBKEY //;
+ debug("missing pubkey $mpk\n");
+ return ($VS_PUBKEY_MISSING, "missing pubkey $mpk");
}
# we could do more checks on what is the actual problem here!
return ($VS_SIGNATURE_ERROR, $out);
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm
index e756914562..3a93fac6f4 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm
@@ -1,4 +1,4 @@
-# $Id: TLDownload.pm 42254 2016-10-11 01:22:02Z preining $
+# $Id: TLDownload.pm 54123 2020-03-06 00:59:56Z preining $
# TeXLive::TLDownload.pm - module for abstracting the download modes
# Copyright 2009-2016 Norbert Preining
# This file is licensed under the GNU General Public License version 2
@@ -9,7 +9,7 @@ package TeXLive::TLDownload;
use TeXLive::TLUtils;
use TeXLive::TLConfig;
-my $svnrev = '$Revision: 42254 $';
+my $svnrev = '$Revision: 54123 $';
my $_modulerevision;
if ($svnrev =~ m/: ([0-9]+) /) {
$_modulerevision = $1;
@@ -20,8 +20,6 @@ sub module_revision {
return $_modulerevision;
}
-my $MAX_ERRORCOUNT = 5;
-
# since Net::HTTP and Net::FTP are shipped by the same packages
# we only test for Net::HTTP, if that fails, let us know ;-)
our $net_lib_avail = 0;
@@ -41,6 +39,18 @@ sub new
{
my $class = shift;
my $self = {};
+ $self->{'initcount'} = 0;
+ bless $self, $class;
+ $self->reinit();
+ return $self;
+}
+
+
+
+
+sub reinit
+{
+ my $self = shift;
my $ua = LWP::UserAgent->new(
agent => "texlive/lwp",
# use LWP::ConnCache, and keep 1 connection open
@@ -51,13 +61,8 @@ sub new
$self->{'ua'} = $ua;
$self->{'enabled'} = 1;
$self->{'errorcount'} = 0;
- bless $self, $class;
- return $self;
+ $self->{'initcout'} += 1;
}
-
-
-
-
sub enabled
{
my $self = shift;
@@ -80,6 +85,11 @@ sub disable
my $self = shift;
$self->{'enabled'} = 0;
}
+sub initcount
+{
+ my $self = shift;
+ return $self->{'initcount'};
+}
sub errorcount
{
my $self = shift;
@@ -110,7 +120,7 @@ sub get_file {
my ($self,$url,$out,$size) = @_;
#
# automatically disable if error count is getting too big
- if ($self->errorcount > $MAX_ERRORCOUNT) {
+ if ($self->errorcount > $TeXLive::TLConfig::MaxLWPErrors) {
$self->disable;
}
# return if disabled
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm
index ce00df5bf7..ba86ac2097 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm
@@ -1,4 +1,4 @@
-# $Id: TLPDB.pm 53820 2020-02-17 03:23:13Z preining $
+# $Id: TLPDB.pm 54630 2020-04-06 11:49:32Z preining $
# TeXLive::TLPDB.pm - tlpdb plain text database files.
# Copyright 2007-2020 Norbert Preining
# This file is licensed under the GNU General Public License version 2
@@ -6,7 +6,7 @@
package TeXLive::TLPDB;
-my $svnrev = '$Revision: 53820 $';
+my $svnrev = '$Revision: 54630 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -1775,11 +1775,20 @@ sub not_virtual_install_package {
}
}
my $media = $self->media;
+ my $container_is_versioned = 0;
if ($media eq 'local_uncompressed') {
$container = \@installfiles;
} elsif ($media eq 'local_compressed') {
for my $ext (map { $Compressors{$_}{'extension'} } keys %Compressors) {
- if (-r "$root/$Archive/$pkg.tar.$ext") {
+ # request versioned containers when local (i.e., ISO image),
+ # since the unversioned symlinks cannot be dereferenced
+ # on Windows.
+ my $rev = $tlpobj->revision;
+ if (-r "$root/$Archive/$pkg.r$rev.tar.$ext") {
+ $container_is_versioned = 1;
+ $container = "$root/$Archive/$pkg.r$rev.tar.$ext";
+ } elsif (-r "$root/$Archive/$pkg.tar.$ext") {
+ $container_is_versioned = 0;
$container = "$root/$Archive/$pkg.tar.$ext";
}
}
@@ -1789,8 +1798,11 @@ sub not_virtual_install_package {
return(0);
}
} elsif (&media eq 'NET') {
+ # Since the NET server cannot be a Windows machine,
+ # ok to request the unversioned file.
$container = "$root/$Archive/$pkg.tar."
. $Compressors{$DefaultCompressorFormat}{'extension'};
+ $container_is_versioned = 0;
}
my $container_str = ref $container eq "ARRAY"
? "[" . join (" ", @$container) . "]" : $container;
@@ -1816,14 +1828,22 @@ sub not_virtual_install_package {
# - there are actually src/doc files present
if ($container_src_split && $opt_src && $tlpobj->srcfiles) {
my $srccontainer = $container;
- $srccontainer =~ s/\.tar\.$CompressorExtRegexp$/.source.tar.$1/;
+ if ($container_is_versioned) {
+ $srccontainer =~ s/\.(r[0-9]*)\.tar\.$CompressorExtRegexp$/.source.$1.tar.$2/;
+ } else {
+ $srccontainer =~ s/\.tar\.$CompressorExtRegexp$/.source.tar.$1/;
+ }
$self->_install_data($srccontainer, $reloc, \@installfiles, $totlpdb,
$tlpobj->srccontainersize, $tlpobj->srccontainerchecksum)
|| return(0);
}
if ($container_doc_split && $real_opt_doc && $tlpobj->docfiles) {
my $doccontainer = $container;
- $doccontainer =~ s/\.tar\.$CompressorExtRegexp$/.doc.tar.$1/;
+ if ($container_is_versioned) {
+ $doccontainer =~ s/\.(r[0-9]*)\.tar\.$CompressorExtRegexp$/.doc.$1.tar.$2/;
+ } else {
+ $doccontainer =~ s/\.tar\.$CompressorExtRegexp$/.doc.tar.$1/;
+ }
$self->_install_data($doccontainer, $reloc, \@installfiles,
$totlpdb, $tlpobj->doccontainersize, $tlpobj->doccontainerchecksum)
|| return(0);
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLPSRC.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLPSRC.pm
index 4cc6af6220..497b8e8b39 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLPSRC.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLPSRC.pm
@@ -1,4 +1,4 @@
-# $Id: TLPSRC.pm 53428 2020-01-16 23:29:27Z karl $
+# $Id: TLPSRC.pm 54413 2020-03-20 06:49:12Z hironobu $
# TeXLive::TLPSRC.pm - module for handling tlpsrc files
# Copyright 2007-2020 Norbert Preining
# This file is licensed under the GNU General Public License version 2
@@ -12,7 +12,7 @@ use TeXLive::TLUtils;
use TeXLive::TLPOBJ;
use TeXLive::TLTREE;
-my $svnrev = '$Revision: 53428 $';
+my $svnrev = '$Revision: 54413 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -184,7 +184,10 @@ sub from_file {
$shortdesc = "";
} elsif ($line =~ /^longdesc$/) {
- $longdesc .= "\n";
+ # We need to use a space here instead of a newline so that strings
+ # read from *.tlpsrc and tlpdb come out the same; see $shortdesc
+ # and $longdesc assignments below.
+ $longdesc .= " ";
} elsif ($line =~ /^longdesc\s+(.*)$/) {
$longdesc .= "$1 ";
@@ -228,6 +231,18 @@ sub from_file {
if ($name =~ m/^[[:space:]]*$/) {
die "Cannot deduce name from file argument and name tag not found";
}
+ #
+ # We should call TeXCatalogue::beautify(), but let's be lazy since not
+ # everything comes up in practice. We want the parsing from .tlpsrc to
+ # result in exactly the same string, including spaces, as parsing from
+ # texlive.tlpdb. Otherwise tl-update-tlpdb's tlpdb_catalogue_compare
+ # will think the strings are always different.
+ $shortdesc =~ s/\s+$//g; # rm trailing whitespace (shortdesc)
+ $longdesc =~ s/\s+$//g; # rm trailing whitespace (longdesc)
+ $longdesc =~ s/\s\s+/ /g; # collapse multiple whitespace characters to one
+ # see comments in beautify.
+ $longdesc =~ s,http://grants.nih.gov/,grants.nih.gov/,g;
+ #
$self->name($name);
$self->category($category);
$self->catalogue($catalogue) if $catalogue;
@@ -946,8 +961,8 @@ On W32 declares files with the extenstion I<.ext> of file type I<name>.
=item C<postaction script file=I<file> [filew32=I<filew32>]>
This postaction executes the given I<file> with two arguments, the first
-being the root of the installation, the second being either the string
-C<install> or C<remove>.
+being either the string C<install> or C<remove>, the second being the
+root of the installation.
If the C<filew32> argument is given this script is run on Windows systems
instead of the one given via C<file>.
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLTREE.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLTREE.pm
index 5a37f52a85..cb327946e3 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLTREE.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLTREE.pm
@@ -1,12 +1,12 @@
-# $Id: TLTREE.pm 48520 2018-08-31 03:41:13Z preining $
+# $Id: TLTREE.pm 54067 2020-03-04 02:40:21Z karl $
# TeXLive::TLTREE.pm - work with the tree of all files
-# Copyright 2007-2018 Norbert Preining
+# Copyright 2007-2020 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
package TeXLive::TLTREE;
-my $svnrev = '$Revision: 48520 $';
+my $svnrev = '$Revision: 54067 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -385,9 +385,9 @@ sub _get_files_matching_glob_pattern
my @candfiles = @{$self->{'_filesofdir'}{$dirpart}};
for my $f (@candfiles) {
- ddebug("matching $f in $dirpart via glob $globline\n");
+ dddebug("matching $f in $dirpart via glob $globline\n");
if ($f =~ /^$basepart$/) {
- ddebug("hit: globline=$globline, $dirpart/$f\n");
+ dddebug("hit: globline=$globline, $dirpart/$f\n");
if ("$dirpart" eq ".") {
push @returnfiles, "$f";
} else {
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
index 34862cd6cc..11c481bfe1 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
@@ -1,4 +1,4 @@
-# $Id: TLUtils.pm 53977 2020-02-29 23:16:52Z karl $
+# $Id: TLUtils.pm 54629 2020-04-06 10:40:48Z preining $
# TeXLive::TLUtils.pm - the inevitable utilities for TeX Live.
# Copyright 2007-2020 Norbert Preining, Reinhard Kotucha
# This file is licensed under the GNU General Public License version 2
@@ -6,7 +6,7 @@
package TeXLive::TLUtils;
-my $svnrev = '$Revision: 53977 $';
+my $svnrev = '$Revision: 54629 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -274,16 +274,16 @@ sub platform {
=item C<platform_name($canonical_host)>
-Convert a canonical host names as returned by C<config.guess> into
-TeX Live platform names.
+Convert ORIG_PLATFORM, a canonical host name as returned by
+C<config.guess>, into a TeX Live platform name.
CPU type is determined by a regexp, and any C</^i.86/> name is replaced
by C<i386>.
-For OS we need a list because what's returned is not likely to match our
-historical names, e.g., C<config.guess> returns C<linux-gnu> but we need
-C<linux>. This list might/should contain OSs which are not currently
-supported.
+For the OS value we need a list because what's returned is not likely to
+match our historical names, e.g., C<config.guess> returns C<linux-gnu>
+but we need C<linux>. This list contains old OSs which are not currently
+supported, just in case.
If a particular platform is not found in this list we use the regexp
C</.*-(.*$)/> as a last resort and hope it provides something useful.
@@ -291,12 +291,15 @@ C</.*-(.*$)/> as a last resort and hope it provides something useful.
=cut
sub platform_name {
- my ($guessed_platform) = @_;
+ my ($orig_platform) = @_;
+ my $guessed_platform = $orig_platform;
+ # try to parse out some bsd variants that use amd64.
$guessed_platform =~ s/^x86_64-(.*-k?)(free|net)bsd/amd64-$1$2bsd/;
my $CPU; # CPU type as reported by config.guess.
my $OS; # O/S type as reported by config.guess.
($CPU = $guessed_platform) =~ s/(.*?)-.*/$1/;
+
$CPU =~ s/^alpha(.*)/alpha/; # alphaev whatever
$CPU =~ s/mips64el/mipsel/; # don't distinguish mips64 and 32 el
$CPU =~ s/powerpc64/powerpc/; # don't distinguish ppc64
@@ -308,7 +311,7 @@ sub platform_name {
$CPU = $guessed_platform =~ /hf$/ ? "armhf" : "armel";
}
- my @OSs = qw(aix cygwin darwin freebsd hpux irix
+ my @OSs = qw(aix cygwin darwin dragonfly freebsd hpux irix
kfreebsd linux netbsd openbsd solaris);
for my $os (@OSs) {
# Match word boundary at the beginning of the os name so that
@@ -317,7 +320,12 @@ sub platform_name {
# solaris2 is matched.
$OS = $os if $guessed_platform =~ /\b$os/;
}
-
+
+ if (! $OS) {
+ warn "$0: could not guess OS from config.guess string: $orig_platform";
+ $OS = "unknownOS";
+ }
+
if ($OS eq "linux") {
# deal with the special case of musl based distributions
# config.guess returns
@@ -337,7 +345,7 @@ sub platform_name {
# We don't use uname numbers here.)
#
# this changes each year, per above:
- my $mactex_darwin = 12; # lowest minor rev supported by x86_64-darwin.
+ my $mactex_darwin = 13; # lowest minor rev supported by x86_64-darwin.
#
# Most robust approach is apparently to check sw_vers (os version,
# returns "10.x" values), and sysctl (processor hardware).
@@ -346,7 +354,7 @@ sub platform_name {
if ($os_major != 10) {
warn "$0: only MacOSX is supported, not $OS $os_major.$os_minor "
. " (from sw_vers -productVersion: $sw_vers)\n";
- return "unknown-unknown";
+ return "unknownmac-unknownmac";
}
if ($os_minor >= $mactex_darwin) {
; # current version, default is ok (x86_64-darwin).
@@ -413,8 +421,9 @@ sub platform_desc {
'universal-darwin' => 'MacOSX universal binaries',
'win32' => 'Windows',
'x86_64-cygwin' => 'Cygwin on x86_64',
- 'x86_64-darwin' => 'MacOSX current (10.12-) on x86_64',
+ 'x86_64-darwin' => 'MacOSX current (10.13-) on x86_64',
'x86_64-darwinlegacy' => 'MacOSX legacy (10.6-) on x86_64',
+ 'x86_64-dragonfly' => 'DragonFlyBSD on x86_64',
'x86_64-linux' => 'GNU/Linux on x86_64',
'x86_64-linuxmusl' => 'GNU/Linux on x86_64 with musl',
'x86_64-solaris' => 'Solaris on x86_64',
@@ -536,7 +545,7 @@ and thus honors various env variables like C<TMPDIR>, C<TMP>, and C<TEMP>.
sub initialize_global_tmpdir {
$::tl_tmpdir = File::Temp::tempdir(CLEANUP => 1);
- ddebug("tl_tempdir: creating global tempdir $::tl_tmpdir\n");
+ ddebug("initialize_global_tmpdir: creating global tempdir $::tl_tmpdir\n");
return ($::tl_tmpdir);
}
@@ -550,7 +559,7 @@ is terminated.
sub tl_tmpdir {
initialize_global_tmpdir() if (!defined($::tl_tmpdir));
my $tmp = File::Temp::tempdir(DIR => $::tl_tmpdir, CLEANUP => 1);
- ddebug("tl_tempdir: creating tempdir $tmp\n");
+ ddebug("tl_tmpdir: creating tempdir $tmp\n");
return ($tmp);
}
@@ -2205,7 +2214,10 @@ sub check_file_and_remove {
if ($tlchecksum ne $checksum) {
tlwarn("TLUtils::check_file: checksums differ for $xzfile:\n");
tlwarn("TLUtils::check_file: tlchecksum=$tlchecksum, arg=$checksum\n");
- $check_file_tmpdir = File::Temp::tempdir("tlcheckfileXXXXXXXX");
+ # on Windows passing a pattern creates the tmpdir in PWD
+ # which means that it will be tried to be created on the DVD
+ # $check_file_tmpdir = File::Temp::tempdir("tlcheckfileXXXXXXXX");
+ $check_file_tmpdir = File::Temp::tempdir();
tlwarn("TLUtils::check_file: removing $xzfile, "
. "but saving copy in $check_file_tmpdir\n");
copy($xzfile, $check_file_tmpdir);
@@ -2790,31 +2802,42 @@ sub download_file {
}
}
+
sub _download_file_lwp {
my ($url, $dest) = @_;
- if (defined($::tldownload_server) && $::tldownload_server->enabled) {
- debug("persistent connection set up, trying to get $url (for $dest)\n");
- my $ret = $::tldownload_server->get_file($url, $dest);
- if ($ret) {
- ddebug("downloading file via persistent connection succeeded\n");
- return $ret;
- } else {
- debug("TLUtils::download_file: persistent connection ok,"
- . " but download failed: $url\n");
- debug("TLUtils::download_file: retrying with wget.\n");
+ if (!defined($::tldownload_server)) {
+ ddebug("::tldownload_server not defined\n");
+ return(0);
+ }
+ if (!$::tldownload_server->enabled) {
+ # try to reinitialize a disabled connection
+ # disabling happens after 6 failed download trials
+ # we just re-initialize the connection
+ if (!setup_persistent_downloads()) {
+ # setup failed, give up
+ debug("reinitialization of LWP download failed\n");
+ return(0);
}
+ # we don't need to check for ->enabled, because
+ # setup_persistent_downloads calls TLDownload->new()
+ # which, if it succeeds, automatically set enabled to 1
+ }
+ # we are still here, so try to download
+ debug("persistent connection set up, trying to get $url (for $dest)\n");
+ my $ret = $::tldownload_server->get_file($url, $dest);
+ if ($ret) {
+ ddebug("downloading file via persistent connection succeeded\n");
+ return $ret;
} else {
- if (!defined($::tldownload_server)) {
- ddebug("::tldownload_server not defined\n");
- } else {
- ddebug("::tldownload_server->enabled is not set\n");
- }
- debug("persistent connection not set up\n");
+ debug("TLUtils::download_file: persistent connection ok,"
+ . " but download failed: $url\n");
+ debug("TLUtils::download_file: retrying with other downloaders.\n");
}
# if we are still here, download with LWP didn't succeed.
return(0);
}
+
sub _download_file_program {
my ($url, $dest, $type) = @_;
if (win32()) {
@@ -3419,9 +3442,11 @@ strings. The message will be omitted unless C<-v -v -v> was specified.
If the log file (see L<process_logging_options>) is defined, it also
writes there.
-This third level debugging message reports messages about processing
-each line of any tlpdb files read, in addition to the first and second
-levels.
+In addition to the first and second levels, this third level debugging
+message reports messages about processing each line of any tlpdb files
+read, and messages about files tested or matched against tlpsrc
+patterns. This output is extremely voluminous, so unless you're
+debugging those parts of the code, it just gets in the way.
=cut
@@ -3840,7 +3865,16 @@ false.
sub setup_persistent_downloads {
if ($TeXLive::TLDownload::net_lib_avail) {
ddebug("setup_persistent_downloads has net_lib_avail set\n");
- $::tldownload_server = TeXLive::TLDownload->new;
+ 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();
+ }
+ } else {
+ $::tldownload_server = TeXLive::TLDownload->new;
+ }
if (!defined($::tldownload_server)) {
ddebug("TLUtils:setup_persistent_downloads: failed to get ::tldownload_server\n");
} else {
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLWinGoo.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLWinGoo.pm
index 1354a89255..9afc47f11e 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLWinGoo.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLWinGoo.pm
@@ -1,4 +1,4 @@
-# $Id: TLWinGoo.pm 53076 2019-12-10 06:20:44Z preining $
+# $Id: TLWinGoo.pm 54289 2020-03-14 10:46:20Z siepo $
# TeXLive::TLWinGoo.pm - Windows goop.
# Copyright 2008-2018 Siep Kroonenberg, Norbert Preining
# This file is licensed under the GNU General Public License version 2
@@ -11,7 +11,7 @@
package TeXLive::TLWinGoo;
-my $svnrev = '$Revision: 53076 $';
+my $svnrev = '$Revision: 54289 $';
my $_modulerevision;
if ($svnrev =~ m/: ([0-9]+) /) {
$_modulerevision = $1;
@@ -140,7 +140,6 @@ BEGIN {
$Registry->Delimiter('/');
$Registry->ArrayValues(0);
$Registry->FixSzNulls(1);
- require Win32::OLE::NLS;
require Win32::Shortcut;
Win32::Shortcut->import( qw( SW_SHOWNORMAL SW_SHOWMINNOACTIVE ) );
require Time::HiRes;
@@ -164,18 +163,20 @@ my $is_win = ($^O =~ /^MSWin/i);
# Win32: import some wrappers for API functions
# failed to get Win32::API::More to work with raw API functions;
-# for now, use a tiny dll with perl-friendly wrappers
# import failures return a null result;
# call imported functions only if true/non-null
my $SendMessage = 0;
my $update_fu = 0;
+my $getlang = 0;
if ($is_win) {
$SendMessage = new Win32::API('user32', 'SendMessageTimeout', 'LLPPLLP', 'L');
debug ("Import failure SendMessage\n") unless $SendMessage;
$update_fu = new Win32::API('shell32', 'SHChangeNotify', 'LIPP', 'V');
debug ("Import failure assoc_notify\n") unless $update_fu;
+ $getlang = Win32::API::More->new('kernel32', 'long GetUserDefaultLangID()');
+ debug ("Import failure GetUserDefaultLangID\n") unless $getlang;
}
=pod
@@ -306,7 +307,8 @@ Two-letter country code representing the locale of the current user
=cut
sub reg_country {
- my $value = Win32::OLE::NLS::GetUserDefaultLangID();
+ my $value = 0;
+ if ($getlang) {$value = $getlang->Call();}
return unless $value;
$value = sprintf ("%04x", $value);
my $lmkey = $Registry -> Open("HKEY_CLASSES_ROOT/MIME/Database/Rfc1766/",
@@ -1416,16 +1418,13 @@ sub maybe_make_ro {
# S-1-5-11 Authenticated users
# S-1-5-32-545 Users
# S-1-5-32-544 administrators
- # S-1-3-0 creator owner
+ # S-1-3-0 creator owner (does not work right)
# S-1-3-1 creator group
- # useful explanations at http://timbolton.net/2010/06/23/
- # /icacls-changing-permissions-on-files-and-folders
-
# /reset is necessary for removing non-standard existing permissions
my $cmd = 'cmd /c "icacls . /reset && icacls . /inheritance:r'.
- ' /grant:r *S-1-5-32-544:(OI)(CI)F /grant *S-1-3-0:(OI)(CI)F'.
- ' /grant *S-1-5-11:(OI)(CI)RX"';
+ ' /grant:r *S-1-5-32-544:(OI)(CI)F'.
+ ' /grant:r *S-1-5-11:(OI)(CI)RX /grant:r *S-1-5-32-545:(OI)(CI)RX /T"';
log "Making read-only\n".`$cmd`."\n";
# go back to original directory
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TeXCatalogue.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TeXCatalogue.pm
index ad54929075..8d9b31729d 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TeXCatalogue.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TeXCatalogue.pm
@@ -1,6 +1,6 @@
-# $Id: TeXCatalogue.pm 53204 2019-12-21 23:18:19Z karl $
+# $Id: TeXCatalogue.pm 54367 2020-03-16 22:59:15Z preining $
# TeXLive::TeXCatalogue - module for accessing the TeX Catalogue
-# Copyright 2007-2019 Norbert Preining
+# Copyright 2007-2020 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
@@ -13,7 +13,7 @@ use Text::Unidecode;
package TeXLive::TeXCatalogue::Entry;
-my $svnrev = '$Revision: 53204 $';
+my $svnrev = '$Revision: 54367 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -81,7 +81,17 @@ sub initialize {
$self->{'name'} = $parser->findvalue("/entry/name")->value();
$self->{'caption'} = beautify($parser->findvalue("/entry/caption")->value());
$self->{'description'} = beautify($parser->findvalue("/entry/description")->value());
- $self->{'license'} = $parser->findvalue('/entry/license/@type')->value();
+ # there can be multiple entries of licenses, collected them all
+ # into one string
+ my $licset = $parser->find('/entry/license');
+ my @liclist;
+ foreach my $node ($licset->get_nodelist) {
+ my $lictype = $parser->find('./@type',$node);
+ push @liclist, "$lictype";
+ }
+ $self->{'license'} = join(' ', @liclist);
+ # was before
+ # $self->{'license'} = $parser->findvalue('/entry/license/@type')->value();
$self->{'version'} = Text::Unidecode::unidecode(
$parser->findvalue('/entry/version/@number')->value());
$self->{'ctan'} = $parser->findvalue('/entry/ctan/@path')->value();
@@ -137,13 +147,28 @@ sub initialize {
sub beautify {
my ($txt) = @_;
+ # transliterate to ascii: it allows the final tlpdb to be pure ascii,
+ # avoiding problems since we don't control the user's terminal encoding
+ # Do first in case spaces are output by the transliteration.
+ $txt = Text::Unidecode::unidecode($txt);
+ #
$txt =~ s/\n/ /g; # make one line
$txt =~ s/^\s+//g; # rm leading whitespace
$txt =~ s/\s+$//g; # rm trailing whitespace
- $txt =~ s/\s\s+/ /g; # multiple spaces to one
- # transliterate to ascii: it allows the final tlpdb to be pure ascii,
- # avoiding problems since we don't control the user's terminal encoding
- return Text::Unidecode::unidecode($txt);
+ $txt =~ s/\s\s+/ /g; # collapse multiple whitespace characters to one
+ $txt =~ s/\t/ /g; # tabs to spaces
+
+ # one last bit of horribleness: there is one url in the descriptions
+ # which is longer than our multilineformat format (in TLPOBJ). The
+ # result is that it is forcibly broken. Apparently there is no way in
+ # Perl to override that. This makes it impossible to get identical
+ # longdesc results. Turns out that removing the "http://" prefix
+ # shortens it enough to fit, so do that. The better solution would be
+ # to use Text::Wrap or some other text-filling code, but going for
+ # quick and dirty here.
+ $txt =~ s,http://grants.nih.gov/,grants.nih.gov/,g;
+
+ return $txt;
}
sub name {