summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm57
1 files changed, 34 insertions, 23 deletions
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