From c849746bad648cb0552ce748449db8f6aac7638b Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 31 May 2000 13:25:34 +0000 Subject: Patch from Ralf Corsepius : Adds a -I option to texi2www. This option is supposed to compatible to the option of the same name in makeinfo, texi2dvi etc. [This patch actually is kind of a hack, but it works :] --- doc/tools/texi2www/texi2www | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'doc/tools') diff --git a/doc/tools/texi2www/texi2www b/doc/tools/texi2www/texi2www index 48b5684c47..e4e291bf0f 100755 --- a/doc/tools/texi2www/texi2www +++ b/doc/tools/texi2www/texi2www @@ -26,6 +26,8 @@ where options are: -footer path -- Specifies the path to a file containing HTML; this files gets inserted near the bottom of each generated HTML file. + -I path -- Append path to the directories being searched for + texi files. -icons path -- Specifies the path, relative to the output directory, to the arrow files. Default is `..'. -base -- Specify the base part fo the genrated short file names @@ -45,6 +47,8 @@ $outcount = 0; # count for the nnnnn part of short names $icons = ".."; # where are the icons $dir = "."; # where are the generated files to go $dirfile = "../dir.html"; # "up" node pointer +@include_path = () ; # list of include directories + while ($ARGV[0] =~ /^-/) { $_ = shift; if (/-base/) {$base = shift; next;} @@ -55,9 +59,11 @@ while ($ARGV[0] =~ /^-/) { if (/-icons/) {$_ = shift; s!\/$!!; $icons = $_; next;} if (/-uselongnames/) {$uselongnames = 1; next;} if (/-verbose/) {$verbose = 1; next;} + if (/-I/) { push @include_path, shift; next;} die $usage; } +print STDERR "include-path:@include_path\n" if $verbose ; &initialize_tables(); # @@ -1239,9 +1245,17 @@ sub initialize_tables ######################################################################## sub open_input_file { - unshift(@texinfo_file,$_[0]); - print "opening $_[0] ...\n" if $debug{open_input_file}; - open($texinfo_file[0],$_[0]) || die "Couldn't open $_[0]: $!\n"; + my $file = "$_[0]" ; + if ( not -f "$file" ) + { + foreach $i ( @include_path ) + { + if ( -f "$i/$_[0]" ) { $file = "$i/$_[0]"; last ; } + } + } + unshift(@texinfo_file,$file); + print "opening $file ...\n" if $debug{open_input_file}; + open($texinfo_file[0],$file) || die "Couldn't open $file: $!\n"; } # open_input_file ######################################################################## -- cgit v1.2.3