diff options
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 28 |
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 { |