summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-12-24 19:19:02 +0000
committerKarl Berry <karl@freefriends.org>2019-12-24 19:19:02 +0000
commit5dd4013570b01bb232984f7f32b4dc557cf47f33 (patch)
tree297805721e458b8272a143207c4e2bfb8004da76 /Master/tlpkg/TeXLive/TLUtils.pm
parent83898f5f87b203c77dc6093cbc951400955dd261 (diff)
tlmgr.pl (check_texmfdbs): make silent if no problems; don't worry if a
directory in TEXMFDBS does not exist; accept only the exact check item names except for leading/trailing whitespace; document. (main): report the contents of the $::tldownload_server hash, not just its address. TLUtils.pm (debug_hash_str): new fn, split from debug_hash. @EXPORT it. (setup_system_one): ddebug the "trying" msg to reduce -v verbosity. git-svn-id: svn://tug.org/texlive/trunk@53225 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm27
1 files changed, 19 insertions, 8 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 61dcff6afef..1c33a0d04ef 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -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()>