summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm35
1 files changed, 9 insertions, 26 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 3db6ce468d8..0d2b9403783 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -1031,32 +1031,15 @@ sub setup_programs {
# check that the programs are actually working
my $nul = "/dev/null";
$nul = "nul" if ($^O =~ /^MSWin(32|64)$/i);
- my $ret = system("$::progs{'lzmadec'} --help >$nul 2>$nul");
- if ($ret == -1) {
- tlwarn ("Cannot start $::progs{'lzmadec'}: $!\n");
- return 0;
- }
- if ($ret > 0) {
- tlwarn ("Starting $::progs{'lzmadec'} --help gave an error: $!\n");
- return 0;
- }
- $ret = system("$::progs{'tar'} --version >$nul 2>$nul");
- if ($ret == -1) {
- tlwarn ("Cannot start $::progs{'tar'}: $!\n");
- return 0;
- }
- if ($ret > 0) {
- tlwarn ("Starting $::progs{'tar'} --version gave an error: $!\n");
- return 0;
- }
- $ret = system("$::progs{'wget'} --version >$nul 2>$nul");
- if ($ret == -1) {
- tlwarn ("Cannot start $::progs{'wget'}: $!\n");
- return 0;
- }
- if ($ret > 0) {
- tlwarn ("Starting $::progs{'wget'} --version gave an error: $!\n");
- return 0;
+ for my $prog ("lzmadec", "tar", "wget") {
+ my $opt = $prog eq "lzmadec" ? "--help" : "--version";
+ my $ret = system("$::progs{$prog} $opt >$nul 2>$nul");
+ if ($ret != 0) {
+ tlwarn ("$::progs{$prog} $opt failed (status $ret): $!\n");
+ tlwarn ("Output is:");
+ system ("$::progs{$prog} $opt");
+ return 0;
+ }
}
return 1;
}