summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-05-07 23:16:48 +0000
committerKarl Berry <karl@freefriends.org>2017-05-07 23:16:48 +0000
commit29e59b7e776608e2473c21378ead58b52e8b6b55 (patch)
treea56499996dc9be6a6e56dc542c8157c61319d588 /Master/tlpkg/TeXLive/TLUtils.pm
parent402bb51d98ac84d3a68773a6a1963da2d1a9925e (diff)
(wsystem): report exit status in warning.
(setup_unix_one): quote '$def' in system() call, hoping to placate spaces in the path. Doc tweaks. git-svn-id: svn://tug.org/texlive/trunk@44243 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm28
1 files changed, 14 insertions, 14 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index d1880caa9fa..7963546835c 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -554,11 +554,12 @@ C<system(@args)>; C<tlwarn> if unsuccessful and return the exit status.
sub wsystem {
my ($msg,@args) = @_;
info("$msg @args ...\n");
- my $status = system(@args);
- if ($status != 0) {
- tlwarn("$0: command failed: @args: $!\n");
+ my $retval = system(@args);
+ if ($retval != 0) {
+ $retval /= 256 if $retval > 0;
+ tlwarn("$0: command failed (status $retval): @args: $!\n");
}
- return $status;
+ return $retval;
}
@@ -578,6 +579,7 @@ sub xsystem {
my $pwd = cwd ();
die "$0: system(@args) failed in $pwd, status $retval";
}
+ return $retval;
}
=item C<run_cmd($cmd)>
@@ -2302,19 +2304,18 @@ sub setup_unix_one {
if (-r $def) {
my $ready = 0;
if (-x $def) {
- ddebug("default $def is readable and executable!\n");
- # checking only for the executable bit is not enough, we have
- # to check for actualy "executability" since a "noexec" mount
- # option may interfere, which is not taken into account by
- # perl's -x test.
+ ddebug("default $def has executable permissions\n");
+ # we have to check for actual "executability" since a "noexec"
+ # mount option may interfere, which is not taken into account by -x.
$::progs{$p} = $def;
if ($arg ne "notest") {
- my $ret = system("$def $arg > /dev/null 2>&1" ); # we are on Unix
+ my $ret = system("'$def' $arg >/dev/null 2>&1" ); # we are on Unix
if ($ret == 0) {
$ready = 1;
debug("Using shipped $def for $p (tested).\n");
} else {
- ddebug("Shipped $def has -x but cannot be executed.\n");
+ ddebug("Shipped $def has -x but cannot be executed, "
+ . "trying tmp copy.\n");
}
} else {
# do not test, just return
@@ -2363,11 +2364,10 @@ sub setup_unix_one {
$test_fallback = 1;
}
if ($test_fallback) {
- # all our playing around and copying did not succeed, try the
- # fallback
+ # all our playing around and copying did not succeed, try PATH.
$::progs{$p} = $p;
if ($arg ne "notest") {
- my $ret = system("$p $arg > /dev/null 2>&1");
+ my $ret = system("$p $arg >/dev/null 2>&1");
if ($ret == 0) {
debug("Using system $p (tested).\n");
} else {