[FFmpeg-cvslog] doc: texi2pod: add -I flag

Mans Rullgard git at videolan.org
Wed Mar 21 02:35:01 CET 2012


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Tue Mar 20 10:53:06 2012 +0000| [b8b207e8963f35a76c6981d7a74d6c08a53abab9] | committer: Mans Rullgard

doc: texi2pod: add -I flag

This allows specifying additional directories to search for
@include files.

Signed-off-by: Mans Rullgard <mans at mansr.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b8b207e8963f35a76c6981d7a74d6c08a53abab9
---

 doc/texi2pod.pl |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/doc/texi2pod.pl b/doc/texi2pod.pl
index 0eb5e8d..94323be 100755
--- a/doc/texi2pod.pl
+++ b/doc/texi2pod.pl
@@ -36,7 +36,7 @@ $shift = "";
 %defs = ();
 $fnno = 1;
 $inf = "";
-$ibase = "";
+ at ibase = ();
 
 while ($_ = shift) {
     if (/^-D(.*)$/) {
@@ -52,6 +52,8 @@ while ($_ = shift) {
         die "flags may only contain letters, digits, hyphens, dashes and underscores\n"
             unless $flag =~ /^[a-zA-Z0-9_-]+$/;
         $defs{$flag} = $value;
+    } elsif (/^-I(.*)$/) {
+        push @ibase, $1 ne "" ? $1 : shift;
     } elsif (/^-/) {
         usage();
     } else {
@@ -61,10 +63,12 @@ while ($_ = shift) {
     }
 }
 
+push @ibase, ".";
+
 if (defined $in) {
     $inf = gensym();
     open($inf, "<$in") or die "opening \"$in\": $!\n";
-    $ibase = $1 if $in =~ m|^(.+)/[^/]+$|;
+    push @ibase, $1 if $in =~ m|^(.+)/[^/]+$|;
 } else {
     $inf = \*STDIN;
 }
@@ -74,7 +78,7 @@ if (defined $out) {
 }
 
 while(defined $inf) {
-while(<$inf>) {
+INF: while(<$inf>) {
     # Certain commands are discarded without further processing.
     /^\@(?:
          [a-z]+index            # @*index: useful only in complete manual
@@ -104,11 +108,10 @@ while(<$inf>) {
         push @instack, $inf;
         $inf = gensym();
 
-        # Try cwd and $ibase.
-        open($inf, "<" . $1)
-            or open($inf, "<" . $ibase . "/" . $1)
-                or die "cannot open $1 or $ibase/$1: $!\n";
-        next;
+        for (@ibase) {
+            open($inf, "<" . $_ . "/" . $1) and next INF;
+        }
+        die "cannot open $1: $!\n";
     };
 
     # Look for blocks surrounded by @c man begin SECTION ... @c man end.



More information about the ffmpeg-cvslog mailing list