* texi2pod.pl: Handle -I.

From-SVN: r113462
This commit is contained in:
Daniel Jacobowitz 2006-05-02 13:50:58 +00:00 committed by Daniel Jacobowitz
parent 7aa20a86fe
commit 84309a323e
2 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2006-04-17 Daniel Jacobowitz <dan@codesourcery.com>
* texi2pod.pl: Handle -I.
2006-02-28 Mark Mitchell <mark@codesourcery.com> 2006-02-28 Mark Mitchell <mark@codesourcery.com>
* gennews (files): Update for GCC 4.1. * gennews (files): Update for GCC 4.1.

View File

@ -36,6 +36,7 @@ $shift = "";
$fnno = 1; $fnno = 1;
$inf = ""; $inf = "";
$ibase = ""; $ibase = "";
@ipath = ();
while ($_ = shift) { while ($_ = shift) {
if (/^-D(.*)$/) { if (/^-D(.*)$/) {
@ -51,6 +52,13 @@ while ($_ = shift) {
die "flags may only contain letters, digits, hyphens, dashes and underscores\n" die "flags may only contain letters, digits, hyphens, dashes and underscores\n"
unless $flag =~ /^[a-zA-Z0-9_-]+$/; unless $flag =~ /^[a-zA-Z0-9_-]+$/;
$defs{$flag} = $value; $defs{$flag} = $value;
} elsif (/^-I(.*)$/) {
if ($1 ne "") {
$flag = $1;
} else {
$flag = shift;
}
push (@ipath, $flag);
} elsif (/^-/) { } elsif (/^-/) {
usage(); usage();
} else { } else {
@ -229,10 +237,12 @@ while(<$inf>) {
$inf = gensym(); $inf = gensym();
$file = postprocess($1); $file = postprocess($1);
# Try cwd and $ibase. # Try cwd and $ibase, then explicit -I paths.
open($inf, "<" . $file) $done = 0;
or open($inf, "<" . $ibase . "/" . $file) foreach $path (".", $ibase, @ipath) {
or die "cannot open $file or $ibase/$file: $!\n"; open($inf, "<" . $path . "/" . $file) and ($done = 1, last);
}
die "cannot find $file" if !$done;
next; next;
}; };