summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-12-05 19:14:32 +0000
committerKarl Berry <karl@freefriends.org>2019-12-05 19:14:32 +0000
commit3c343eb00f6ef34f834a4d05eee540a4433968a3 (patch)
treeec8cf0b774d85408c59a8721604c7023851c9c8d /Master/tlpkg/TeXLive
parent2e642f5e57749615552f2a1a0b71f9eb30c1f39a (diff)
tl-update-tlpdb: new option --catalogue-compare for (ultimately) forcing
new revisions on Catalogue updates wrt tlnet; will run occasionally from cron. (tlpdb_catalogue_compare, tlpobj_catalogue_equal, equal_strings, equal_hashes, is_hash_ref): new fns to implement it. (compare_and_fix_tlpdbs): rename main hash %cmp from %ret, since it is not what gets returned. Return early if no different_packages data. (copy_revision_over): rename from move_revisions_over, since orig is untouched. TeXCatalogue.pm (initialize): use XML::XPath::findvalue instead of find(), so we end up with a string, not (potentially, e.g., contact-home) an XML::XPath::NodeSet, which overloads the comparison operators in an unusual (buggy?) way. https://rt.cpan.org/Ticket/Display.html?id=131114 git-svn-id: svn://tug.org/texlive/trunk@53031 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TeXCatalogue.pm59
1 files changed, 31 insertions, 28 deletions
diff --git a/Master/tlpkg/TeXLive/TeXCatalogue.pm b/Master/tlpkg/TeXLive/TeXCatalogue.pm
index 273863202f3..ff21c719e3b 100644
--- a/Master/tlpkg/TeXLive/TeXCatalogue.pm
+++ b/Master/tlpkg/TeXLive/TeXCatalogue.pm
@@ -1,10 +1,10 @@
# $Id$
# 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;
@@ -14,15 +14,27 @@ use Text::Unidecode;
package TeXLive::TeXCatalogue::Entry;
my $svnrev = '$Revision$';
-my $_modulerevision;
-if ($svnrev =~ m/: ([0-9]+) /) {
- $_modulerevision = $1;
-} else {
- $_modulerevision = "unknown";
-}
-sub module_revision {
- return $_modulerevision;
-}
+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