diff options
author | Norbert Preining <norbert@preining.info> | 2019-12-07 03:00:49 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-12-07 03:00:49 +0000 |
commit | f158c892f4714e2dfef87c5edf8cd679fd09bb2b (patch) | |
tree | f8cae0221bb28490d61fc9a531ac4d087186e273 /systems/texlive/tlnet/tlpkg/TeXLive | |
parent | ac57c892e88b77eb217641d4a1059da681320633 (diff) |
CTAN sync 201912070300
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/TeXLive')
-rw-r--r-- | systems/texlive/tlnet/tlpkg/TeXLive/TLConfig.pm | 17 | ||||
-rw-r--r-- | systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm | 10 | ||||
-rw-r--r-- | systems/texlive/tlnet/tlpkg/TeXLive/TLPOBJ.pm | 98 | ||||
-rw-r--r-- | systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm | 57 | ||||
-rw-r--r-- | systems/texlive/tlnet/tlpkg/TeXLive/TeXCatalogue.pm | 63 |
5 files changed, 141 insertions, 104 deletions
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLConfig.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLConfig.pm index b245c6845d..8330862b09 100644 --- a/systems/texlive/tlnet/tlpkg/TeXLive/TLConfig.pm +++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLConfig.pm @@ -1,4 +1,4 @@ -# $Id: TLConfig.pm 52745 2019-11-12 18:18:40Z karl $ +# $Id: TLConfig.pm 53037 2019-12-05 23:53:35Z karl $ # TeXLive::TLConfig.pm - module exporting configuration values # Copyright 2007-2019 Norbert Preining # This file is licensed under the GNU General Public License version 2 @@ -6,7 +6,7 @@ package TeXLive::TLConfig; -my $svnrev = '$Revision: 52745 $'; +my $svnrev = '$Revision: 53037 $'; my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown"; sub module_revision { return $_modulerevision; } @@ -30,6 +30,7 @@ BEGIN { %Compressors $InfraLocation $DatabaseName + $DatabaseLocation $PackageBackupDir $BlockSize $Archive @@ -82,10 +83,12 @@ our $DefaultCategory = "Package"; # relative to a root (e.g., the Master/, or the installation path) our $InfraLocation = "tlpkg"; our $DatabaseName = "texlive.tlpdb"; +our $DatabaseLocation = "$InfraLocation/$DatabaseName"; # location of backups in default autobackup setting (under tlpkg) our $PackageBackupDir = "$InfraLocation/backups"; +# for computing disk usage; this is most common. our $BlockSize = 4096; # timeout for network connections (wget, LWP) in seconds @@ -312,6 +315,16 @@ The subdirectory with various infrastructure files (C<texlive.tlpdb>, tlpobj files, ...) relative to the root of the installation; currently C<tlpkg>. +=item C<$TeXLive::TLConfig::DatabaseName> + +The name of our so-called database file: C<texlive.tlpdb>. It's just a +plain text file, not any kind of relational or other database. + +=item C<$TeXLive::TLConfig::DatabaseLocation> + +Concatenation of C<InfraLocation> "/" C<DatabaseName>, i.e., +C<tlpkg/texlive.tlpdb>. + =item C<$TeXLive::TLConfig::BlockSize> The assumed block size, currently 4k. diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm index 93e20de18f..ac686c9d4f 100644 --- a/systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm +++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm @@ -1,4 +1,4 @@ -# $Id: TLPDB.pm 52706 2019-11-09 17:42:02Z karl $ +# $Id: TLPDB.pm 53037 2019-12-05 23:53:35Z karl $ # TeXLive::TLPDB.pm - tlpdb plain text database files. # Copyright 2007-2019 Norbert Preining # This file is licensed under the GNU General Public License version 2 @@ -6,7 +6,7 @@ package TeXLive::TLPDB; -my $svnrev = '$Revision: 52706 $'; +my $svnrev = '$Revision: 53037 $'; my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown"; sub module_revision { return $_modulerevision; } @@ -91,7 +91,7 @@ C<TeXLive::TLPDB> -- A database of TeX Live Packages =cut use TeXLive::TLConfig qw($CategoriesRegexp $DefaultCategory $InfraLocation - $DatabaseName $MetaCategoriesRegexp $Archive + $DatabaseName $DatabaseLocation $MetaCategoriesRegexp $Archive $DefaultCompressorFormat %Compressors $CompressorExtRegexp %TLPDBOptions %TLPDBSettings $ChecksumExtension $RelocPrefix $RelocTree); @@ -148,7 +148,7 @@ sub new { } if (defined($self->{'root'})) { my $nr_packages_read - = $self->from_file("$self->{'root'}/$InfraLocation/$DatabaseName", + = $self->from_file("$self->{'root'}/$DatabaseLocation", 'verify' => $verify); if ($nr_packages_read == 0) { # that is bad, we didn't read anything, so return undef. @@ -1205,7 +1205,7 @@ sub location { tlwarn("TLPDB: cannot get location of a virtual tlpdb\n"); return 0; } - return "$self->{'root'}/$InfraLocation/$DatabaseName"; + return "$self->{'root'}/$DatabaseLocation"; } =pod diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLPOBJ.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLPOBJ.pm index b1be641584..2ef24d8b70 100644 --- a/systems/texlive/tlnet/tlpkg/TeXLive/TLPOBJ.pm +++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLPOBJ.pm @@ -1,4 +1,4 @@ -# $Id: TLPOBJ.pm 52931 2019-11-26 23:04:18Z karl $ +# $Id: TLPOBJ.pm 53032 2019-12-05 19:15:11Z karl $ # TeXLive::TLPOBJ.pm - module for using tlpobj files # Copyright 2007-2019 Norbert Preining # This file is licensed under the GNU General Public License version 2 @@ -6,7 +6,7 @@ package TeXLive::TLPOBJ; -my $svnrev = '$Revision: 52931 $'; +my $svnrev = '$Revision: 53032 $'; my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown"; sub module_revision { return $_modulerevision; } @@ -263,7 +263,7 @@ sub _recompute_size { $nrivblocks += int($s/$TeXLive::TLConfig::BlockSize); $nrivblocks++ if (($s%$TeXLive::TLConfig::BlockSize) > 0); } else { - printf STDERR "size for $f not defined, strange ...\n"; + tlwarn("$0: (TLPOBJ::_recompute_size) size of $type $f undefined?!\n"); } } } @@ -458,8 +458,8 @@ sub as_json { my %newd; $newd{'file'} = $f; if (defined($dfd->{$f})) { - # TODO should we check that there are actually only "details" - # and "language" as key? + # "details" and "language" keys now, but more could be added any time. + # (Such new keys would have to be added in update_from_catalogue.) for my $k (keys %{$dfd->{$f}}) { $newd{$k} = $dfd->{$f}->{$k}; } @@ -509,7 +509,7 @@ sub replace_reloc_prefix { } $self->docfiledata(%newdata); # if there are bin files they have definitely NOT the - # texmf-dist prefix, so we cannot cancel it anyway + # texmf-dist prefix, so no reloc to replace } sub cancel_common_texmf_tree { @@ -855,7 +855,7 @@ sub update_from_catalogue { $foo =~ s/^.Date: //; # trying to extract the interesting part of a subversion date # keyword expansion here, e.g., - # $Date: 2019-11-27 00:04:18 +0100 (Wed, 27 Nov 2019) $ + # <dollar>Date: 2007-08-15 19:43:35 +0100 (Wed, 27 Nov 2019) <dollar> # ->2007-08-15 19:43:35 +0100 $foo =~ s/ \(.*\)( *\$ *)$//; # maybe nothing after parens $self->cataloguedata->{'date'} = $foo; @@ -1497,26 +1497,38 @@ files describing a self-contained package. =head1 FILE SPECIFICATION -Please see L<TeXLive::TLPSRC> documentation for the specification. The -only differences are that the various C<*pattern> keys are invalid, and -instead there are the respective C<*files> keys described below. Furthermore -some more I<keys> is allowed: C<revision> which specifies the maximum of -all last changed revision of files contained in the package, anything -starting with C<catalogue-> specifying information coming from the -TeX Catalogue, and C<relocated> taking either 0 or 1 indicating that -this packages has been relocated, i.e., in the containers the -initial C<texmf-dist> directory has been stripped off. +See L<TeXLive::TLPSRC> documentation for the general syntax and +specification. The differences are: + +=over 4 + +=item The various C<*pattern> keys are invalid. + +=item Instead, there are respective C<*files> keys described below. +All the C<*files> keys are followed by a list of files in the given +category, one per line, each line I<indented> by one space. -All these keys have in common that they are followed by a list of files -I<indented> by one space. They differ only in the first line itself -(described below). +=item Several new keys beginning with C<catalogue-> specify information +automatically taken from the TeX Catalogue. + +=item A new key C<revision> is defined (automatically computed), +which specifies the maximum of all the last-changed revisions of files +contained in the package, plus possible other changes. By default, +Catalogue-only changes do not change the revision. + +=item A new key C<relocated>, either 0 or 1, which indicates that this +packages has been relocated, i.e., in the containers the initial +C<texmf-dist> directory has been stripped off and replaced with static +string C<RELOC>. + +=back =over 4 =item C<srcfiles>, C<runfiles>, C<binfiles>, C<docfiles> -each of these items contains addition the sum of sizes of the -single files (in number of C<TeXLive::TLConfig::BlockSize> blocks, which -is currently 4k). +each of these items contains addition the sum of sizes of the single +files (in number of C<TeXLive::TLConfig::BlockSize> blocks,currently +4k). srcfiles size=NNNNNN runfiles size=NNNNNN @@ -1528,25 +1540,26 @@ above: docfiles size=NNNNNN -But the lines listing the files are allowed to have additional tags: +But the lines listing the files are allowed to have additional tags, +which come from the TeX Catalogue. /------- excerpt from achemso.tlpobj |... - |docfiles size=1702468 - | texmf-dist/doc/latex/aeguill/README details="Package Readme" + |docfiles size=220 | texmf-dist/doc/latex/achemso/achemso.pdf details="Package documentation" language="en" |... -Currently only the tags C<details> and C<language> are allowed. These +Currently only the tags C<details> and C<language> are supported. These additional information can be accessed via the C<docfiledata> function returning a hash with the respective files (including path) as key. =item C<binfiles> -Since C<binfiles> are different for the different architectures one -C<tlpobj> file can contain C<binfiles> lines for different -architectures. The architecture is specified on the C<binfiles> using -the C<arch=>I<XXX> tag. Thus, C<binfiles> lines look like +Since C<binfiles> can be different for different architectures, a single +C<tlpobj> file can, and typically does, contain C<binfiles> lines for +all available architectures. The architecture is specified on the +C<binfiles> using the C<arch=>I<XXX> tag. Thus, C<binfiles> lines look +like binfiles arch=XXXX size=NNNNN @@ -1557,28 +1570,26 @@ with C<|> characters inserted to show the indentation: |name dvipsk |category TLCore - |revision 4427 - |docfiles size=959434 + |revision 52851 + |docfiles size=285 | texmf-dist/doc/dvips/dvips.html | ... - |runfiles size=1702468 + |runfiles size=93 | texmf-dist/dvips/base/color.pro | ... | texmf-dist/scripts/pkfix/pkfix.pl - |binfiles arch=i386-solaris size=329700 + |binfiles arch=i386-solaris size=87 | bin/i386-solaris/afm2tfm | bin/i386-solaris/dvips - | bin/i386-solaris/pkfix - |binfiles arch=win32 size=161280 + |binfiles arch=win32 size=51 | bin/win32/afm2tfm.exe | bin/win32/dvips.exe - | bin/win32/pkfix.exe |... =head1 PACKAGE VARIABLES -TeXLive::TLPOBJ has one package wide variable which is C<containerdir> where -generated container files are saved (if not otherwise specified. +TeXLive::TLPOBJ has one package-wide variable, C<containerdir>, which is +where generated container files are saved (if not otherwise specified). TeXLive::TLPOBJ->containerdir("path/to/container/dir"); @@ -1638,7 +1649,7 @@ activated for that install medium. =head1 OTHER FUNCTIONS -The following functions can be called for an C<TLPOBJ> object: +The following functions can be called for a C<TLPOBJ> object: =over 4 @@ -1844,10 +1855,9 @@ lines for language.dat.lua that can be generated from the tlpobj. =head1 SEE ALSO -The modules L<TeXLive::TLConfig>, L<TeXLive::TLCrypto>, -L<TeXLive::TLUtils>, L<TeXLive::TLPSRC>, L<TeXLive::TLPDB>, -L<TeXLive::TLTREE>, L<TeXLive::TeXCatalogue>, etc., and the -documentation in the repository: C<Master/tlpkg/doc/>. +The other modules in C<Master/tlpkg/TeXLive/> (L<TeXLive::TLConfig> and +the rest), and the scripts in C<Master/tlpg/bin/> (especially +C<tl-update-tlpdb>), the documentation in C<Master/tlpkg/doc/>, etc. =head1 AUTHORS AND COPYRIGHT diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm index 039820a3cc..0496833630 100644 --- a/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm +++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm @@ -1,4 +1,4 @@ -# $Id: TLUtils.pm 52975 2019-11-30 07:10:45Z preining $ +# $Id: TLUtils.pm 53032 2019-12-05 19:15:11Z karl $ # TeXLive::TLUtils.pm - the inevitable utilities for TeX Live. # Copyright 2007-2019 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: 52975 $'; +my $svnrev = '$Revision: 53032 $'; my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown"; sub module_revision { return $_modulerevision; } @@ -14,7 +14,7 @@ sub module_revision { return $_modulerevision; } =head1 NAME -C<TeXLive::TLUtils> -- utilities used in TeX Live infrastructure +C<TeXLive::TLUtils> - utilities used in TeX Live infrastructure =head1 SYNOPSIS @@ -3477,6 +3477,7 @@ sub debug_hash { my @items = (); for my $key (sort keys %hash) { my $val = $hash{$key}; + $val = ".undef" if ! defined $val; $key =~ s/\n/\\n/g; $val =~ s/\n/\\n/g; push (@items, "$key:$val"); @@ -4038,17 +4039,20 @@ sub download_to_temp_or_file { return; } -# compare_tlpobjs -# returns a hash -# $ret{'revision'} = "leftRev:rightRev" if revision differ -# $ret{'removed'} = \[ list of files removed from A to B ] -# $ret{'added'} = \[ list of files added from A to B ] -# + +=item C<< compare_tlpobjs($tlpA, $tlpB) >> + +Compare the two passed L<TLPOBJ> objects. Returns a hash: + + $ret{'revision'} = "revA:revB" # if revisions differ + $ret{'removed'} = \[ list of files removed from A to B ] + $ret{'added'} = \[ list of files added from A to B ] + +=cut + sub compare_tlpobjs { my ($tlpA, $tlpB) = @_; my %ret; - my @rem; - my @add; my $rA = $tlpA->revision; my $rB = $tlpB->revision; @@ -4068,20 +4072,27 @@ sub compare_tlpobjs { for my $f (@fA) { $removed{$f} = 1; } for my $f (@fB) { delete($removed{$f}); $added{$f} = 1; } for my $f (@fA) { delete($added{$f}); } - @rem = sort keys %removed; - @add = sort keys %added; + my @rem = sort keys %removed; + my @add = sort keys %added; $ret{'removed'} = \@rem if @rem; $ret{'added'} = \@add if @add; + return %ret; } -# -# compare_tlpdbs -# return several hashes -# @{$ret{'removed_packages'}} = list of removed packages from A to B -# @{$ret{'added_packages'}} = list of added packages from A to B -# $ret{'different_packages'}->{$package} = output of compare_tlpobjs -# + +=item C<< compare_tlpdbs($tlpdbA, $tlpdbB, @more_ignored_pkgs) >> + +Compare the two passed L<TLPDB> objects, ignoring the packages +C<00texlive.installer>, C<00texlive.image>, and any passed +C<@more_ignore_pkgs>. Returns a hash: + + $ret{'removed_packages'} = \[ list of removed packages from A to B ] + $ret{'added_packages'} = \[ list of added packages from A to B ] + $ret{'different_packages'}->{$package} = output of compare_tlpobjs + +=cut + sub compare_tlpdbs { my ($tlpdbA, $tlpdbB, @add_ignored_packs) = @_; my @ignored_packs = qw/00texlive.installer 00texlive.image/; @@ -4658,9 +4669,9 @@ __END__ =head1 SEE ALSO -The modules L<TeXLive::TLConfig>, L<TeXLive::TLCrypto>, -L<TeXLive::TLDownload>, L<TeXLive::TLWinGoo>, etc., and the -documentation in the repository: C<Master/tlpkg/doc/>. +The other modules in C<Master/tlpkg/TeXLive/> (L<TeXLive::TLConfig> and +the rest), and the scripts in C<Master/tlpg/bin/> (especially +C<tl-update-tlpdb>), the documentation in C<Master/tlpkg/doc/>, etc. =head1 AUTHORS AND COPYRIGHT diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TeXCatalogue.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TeXCatalogue.pm index 4f6721dc17..a9f94e33ff 100644 --- a/systems/texlive/tlnet/tlpkg/TeXLive/TeXCatalogue.pm +++ b/systems/texlive/tlnet/tlpkg/TeXLive/TeXCatalogue.pm @@ -1,10 +1,10 @@ -# $Id: TeXCatalogue.pm 48521 2018-08-31 03:41:21Z preining $ +# $Id: TeXCatalogue.pm 53031 2019-12-05 19:14:32Z karl $ # TeXLive::TeXCatalogue - module for accessing the TeX Catalogue -# Copyright 2007-2018 Norbert Preining +# Copyright 2007-2019 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. # -# Loads of code taken from the catalogue checking script of Robin Fairbairns. +# Loads of code adapted from the catalogue checking script of Robin Fairbairns. use XML::Parser; use XML::XPath; @@ -13,16 +13,28 @@ use Text::Unidecode; package TeXLive::TeXCatalogue::Entry; -my $svnrev = '$Revision: 48521 $'; -my $_modulerevision; -if ($svnrev =~ m/: ([0-9]+) /) { - $_modulerevision = $1; -} else { - $_modulerevision = "unknown"; -} -sub module_revision { - return $_modulerevision; -} +my $svnrev = '$Revision: 53031 $'; +my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown"; +sub module_revision { return $_modulerevision; } + +=pod + +=head1 NAME + +TeXLive::TeXCatalogue - accessing the TeX Catalogue for TeX Live + +=head1 SYNOPSIS + +missing + +=head1 DESCRIPTION + +The L<TeXLive::TeXCatalogue> module provides access to the data stored +in the TeX Catalogue. + +DOCUMENTATION MISSING, SORRY!!! + +=cut my $_parser = XML::Parser->new( ErrorContext => 2, @@ -106,16 +118,16 @@ sub initialize { } # parse the contact entries foreach my $node ($parser->find('/entry/contact')->get_nodelist) { - my $contacttype = $parser->find('./@type',$node); - my $contacthref = $parser->find('./@href',$node); + my $contacttype = $parser->findvalue('./@type',$node); + my $contacthref = $parser->findvalue('./@href',$node); if ($contacttype && $contacthref) { $self->{'contact'}{$contacttype} = $contacthref; } } # parse the keyval/topic entries foreach my $node ($parser->find('/entry/keyval')->get_nodelist) { - my $k = $parser->find('./@key',$node); - my $v = $parser->find('./@value',$node); + my $k = $parser->findvalue('./@key',$node); + my $v = $parser->findvalue('./@value',$node); # for now we only support evaluating the 'topic' key if ("$k" eq 'topic') { push @{$self->{'topic'}}, "$v"; @@ -309,20 +321,11 @@ sub entries { __END__ -=head1 NAME - -TeXLive::TeXCatalogue - Accessing the TeX Catalogue - -=head1 SYNOPSIS +=head1 SEE ALSO -missing - -=head1 DESCRIPTION - -The L<TeXLive::TeXCatalogue> module provides access to the data stored -in the TeX Catalogue. - -DOCUMENTATION MISSING, SORRY!!! +The other modules in C<Master/tlpkg/TeXLive/> (L<TeXLive::TLConfig> and +the rest), and the scripts in C<Master/tlpg/bin/> (especially +C<tl-update-tlpdb>), the documentation in C<Master/tlpkg/doc/>, etc. =head1 AUTHORS AND COPYRIGHT |