summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-08-02 10:00:34 +0000
committerNorbert Preining <preining@logic.at>2008-08-02 10:00:34 +0000
commitcb5c85fde6b1cf5fe298890a0536d42add64bc37 (patch)
tree699c53da450966e13ecfd18506606109a0bbb532 /Master/tlpkg/TeXLive
parent0d12c63e2184b30d4e22a7ae5d8f7120a5584cb5 (diff)
TLUtils:setup_programs: implement Karl's suggestions
git-svn-id: svn://tug.org/texlive/trunk@10008 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-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;
}