summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-12-26 03:00:38 +0000
committerNorbert Preining <norbert@preining.info>2019-12-26 03:00:38 +0000
commit61662d8a6546ba9debc2b0793ed12646083eb394 (patch)
tree80390a67160b557b07f717bf946ab7140fbcbe33 /systems/texlive/tlnet/tlpkg/TeXLive
parent3009cc3d943aa281945de7d2204ebbe359bd405f (diff)
CTAN sync 201912260300
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/TeXLive')
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm31
1 files changed, 21 insertions, 10 deletions
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
index 9ca41db37b..c7bc216372 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
@@ -1,4 +1,4 @@
-# $Id: TLUtils.pm 53221 2019-12-24 00:15:50Z karl $
+# $Id: TLUtils.pm 53225 2019-12-24 19:19:02Z 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: 53221 $';
+my $svnrev = '$Revision: 53225 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -89,6 +89,7 @@ C<TeXLive::TLUtils> - utilities used in TeX Live infrastructure
TeXLive::TLUtils::log($str1, ...); # only to log file
TeXLive::TLUtils::tlwarn($str1, ...); # warn on stderr and log
TeXLive::TLUtils::tldie($str1, ...); # tlwarn and die
+ TeXLive::TLUtils::debug_hash_str($label, HASH); # stringified HASH
TeXLive::TLUtils::debug_hash($label, HASH); # warn stringified HASH
TeXLive::TLUtils::backtrace(); # return call stack as string
TeXLive::TLUtils::process_logging_options($texdir); # handle -q -v* -logfile
@@ -216,7 +217,8 @@ BEGIN {
&SshURIRegex
);
@EXPORT = qw(setup_programs download_file process_logging_options
- tldie tlwarn info log debug ddebug dddebug debug_hash
+ tldie tlwarn info log debug ddebug dddebug debug
+ debug_hash_str debug_hash
win32 xchdir xsystem run_cmd system_pipe sort_archs);
}
@@ -2563,10 +2565,10 @@ sub setup_one {
sub setup_system_one {
my ($p, $arg) = @_;
my $nulldev = nulldev();
- debug("trying to set up system $p, arg $arg\n");
+ ddebug("trying to set up system $p, arg $arg\n");
my $ret = system("$p $arg >$nulldev 2>&1");
if ($ret == 0) {
- debug("program $p found in the path\n");
+ debug("program $p found in path\n");
$::progs{$p} = $p;
return(1);
} else {
@@ -3469,14 +3471,19 @@ sub tldie {
}
}
-=item C<debug_hash ($label, HASH)>
+=item C<debug_hash_str($label, HASH)>
-Write LABEL followed by HASH elements, all on one line, to stderr.
-If HASH is a reference, it is followed.
+Return LABEL followed by HASH elements, followed by a newline, as a
+single string. If HASH is a reference, it is followed (but no recursive
+derefencing).
+
+=item C<debug_hash($label, HASH)>
+
+Write the result of C<debug_hash_str> to stderr.
=cut
-sub debug_hash {
+sub debug_hash_str {
my ($label) = shift;
my (%hash) = (ref $_[0] && $_[0] =~ /.*HASH.*/) ? %{$_[0]} : @_;
@@ -3492,7 +3499,11 @@ sub debug_hash {
$str .= join (",", @items);
$str .= "}";
- warn "$str\n";
+ return "$str\n";
+}
+
+sub debug_hash {
+ warn &debug_hash_str(@_);
}
=item C<backtrace()>