[l2h] l2h99_1: Some problems with install-test
Luc Van Eycken
Luc Van Eycken <Luc.VanEycken@esat.kuleuven.ac.be>
Wed, 21 Apr 1999 16:46:16 +0200
I've downloaded the l2h99_1 distribution, but I have some problems when I
run install-test:
1) One should allow a "." in the path of a perl script; in my case
"teTeX-0.9" is one of the path elements.
2) Not all temporary files are deleted. This is due to the fact that
&unlink (from Override.pm) uses only one argument, while install-test
gives two arguments. To be conform with the core definition, &unlink
should accept a list of parameters.
3) &find_executable (from Override.pm) requires at least two arguments,
while install-test only passes one. One way to solve it is to let the
second argument default to $ENV{PATH}.
4) &which can not cope with an absolute path. Since we already have
&find_executable, I see no reason not to replace &which with
&find_executable.
5) &substitute_var_val is used with the wrong arguments for variable
$Web2C. This is only detected if the previous error 2 is corrected,
resulting in a complete insane latex2html.config file.
Patches are included below.
I noticed also that, even when $Web2C is set, latex2html can't always
handle the TEXINPUTS environment variable (e.g., when it contains "!!" or
"//"). I'll try to look into this before making any further suggestions.
Best regards,
Luc Van Eycken
-------------------------8<--------------------------8<-------------------------
Time-stamp: <1999-04-20 11:38:54 veycken>
These patches remedie some problems with install-test:
- wrong arguments of &substitute_var_val for variable $Web2C
- allow `.' in the path of a perl script
- &find_executable should have a default second argument of $ENV{PATH}
- &which can not cope with an absolute path as executable, use &find_executable
- unlink (from Override.pm) uses only 1 argument, while install-test gives 2
--- latex2html/install-test.orig Thu Apr 15 19:39:20 1999
+++ latex2html/install-test Fri Apr 16 13:33:16 1999
@@ -29,7 +29,7 @@
print<<"#EOM";
-This is install-test for LaTeX2HTML V98.2
+This is install-test for LaTeX2HTML V99.1
=========================================
#EOM
@@ -102,9 +102,10 @@
. "successful.\n";
if (&find_executable('kpsewhich')) {
- &substitute_var_val($CONFIG_FILE, Web2C, 1);
+ &substitute_var_val("$CONFIG_FILE", "^\\\$Web2C\\\s*=.*\$",
+ "\$Web2C = 1; ");
print "Web2C found, using it\n";
}
if ($^O =~ MSWin32) {
print "Specific Win32 configuration...\n";
@@ -344,7 +345,7 @@
}
} elsif ($type eq "perl") {
# if (! ($what =~ m"^perl\s+([\w:\\/-]*)")) {
- if (! ($what =~ m"^\Q$perl\E\s+([\w:\\/-]*)")) {
+ if (! ($what =~ m"^\Q$perl\E\s+([\w:\\/.-]*)")) {
if (! -f $what) {
$fail = "Error: Could not find $what perl script.\n";
} else {
@@ -360,36 +361,14 @@
# chop;
# if ((/no /) || (/not found/) || (/^\s*$/)) {
# $fail = "Warning: $name was * NOT * found.\n";}
- if ($^O =~ MSWin32) {
- $what = &find_executable($what);
- } else {
-#RRM: use Perl only, in case 'sh' is not the shell,
-# thanks Michel Goossens
-# $_ = `sh -c "type $what"`;
-# chop;
-# if ((/no /) || (/not found/) || (/^\s*$/)) {
- $what = &which($what);
- $fail = "Warning: $name was * NOT * found.\n"
- unless $what;
-# } else {
-# $what = $_;
-# }
- }
+ $what = &find_executable($what);
+ $fail = "Warning: $name was * NOT * found.\n" unless $what;
} elsif (($type eq "dir") && (! -d $what)) {
$fail = "Error: directory $name was * NOT * found.\n";
}
($fail ? print $fail : print "$name was found.\n");
$fail;
}
-
-sub which {
- my($name) = @_;
- my($dir);
- foreach $dir (split(/\Q$envkey\E/,$ENV{'PATH'})) {
- return("$dir$dd$name") if (-x "$dir$dd$name");
- }
- return('');
-}
# Page 164 of the Camel book.
sub get_first_line_of_stderr {
--- latex2html/Override.pm.orig Tue Aug 25 06:17:36 1998
+++ latex2html/Override.pm Fri Apr 16 11:53:15 1999
@@ -177,11 +177,11 @@
}
sub unlink {
- my ($from) = @_;
+# my ($from) = @_;
# if ($OS =~ os2) {
# system("rm", $from);
# } else {
- CORE::unlink($from) ;
+ CORE::unlink(@_) ;
# }
}
@@ -318,6 +318,7 @@
sub find_executable {
local($fullname);
local($name,@PATH) = @_;
+ $PATH[0] = $ENV{'PATH'} unless @PATH;
if ($OS =~ /os2|MSWin32|dos/) {
if(&absolute_path($name)) {
if(-e "$name") {