[FFmpeg-devel] [PATCH 3/8] doc/texi2pod: Use GCC implementation of -I flag

Stefano Sabatini stefasab at gmail.com
Fri Jan 24 12:39:05 CET 2014


On date Wednesday 2014-01-22 20:04:01 -0800, Timothy Gu encoded:
> Changed to GCC r105780, r113462, and r114271.
> 
> Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
> ---
>  doc/texi2pod.pl | 28 +++++++++++++++++++---------
>  1 file changed, 19 insertions(+), 9 deletions(-)
> 
> diff --git a/doc/texi2pod.pl b/doc/texi2pod.pl
> index ef2f7bc..d684ba4 100755
> --- a/doc/texi2pod.pl
> +++ b/doc/texi2pod.pl
> @@ -38,7 +38,8 @@ $shift = "";
>  %defs = ();
>  $fnno = 1;
>  $inf = "";
> - at ibase = ();
> +$ibase = "";
> + at ipath = ();
>  
>  while ($_ = shift) {
>      if (/^-D(.*)$/) {
> @@ -55,7 +56,12 @@ while ($_ = shift) {
>              unless $flag =~ /^[a-zA-Z0-9_-]+$/;
>          $defs{$flag} = $value;
>      } elsif (/^-I(.*)$/) {

> -        push @ibase, $1 ne "" ? $1 : shift;
> +        if ($1 ne "") {
> +            $flag = $1;
> +        } else {
> +	        $flag = shift;
> +	    }
> +        push (@ipath, $flag);

Weird indent.

>      } elsif (/^-/) {
>          usage();
>      } else {
> @@ -65,12 +71,10 @@ while ($_ = shift) {
>      }
>  }
>  

> -push @ibase, ".";
> -
>  if (defined $in) {
>      $inf = gensym();
>      open($inf, "<$in") or die "opening \"$in\": $!\n";
> -    push @ibase, $1 if $in =~ m|^(.+)/[^/]+$|;
> +    $ibase = $1 if $in =~ m|^(.+)/[^/]+$|;
>  } else {
>      $inf = \*STDIN;
>  }
> @@ -109,11 +113,17 @@ INF: while(<$inf>) {
>      /^\@include\s+(.+)$/ and do {
>          push @instack, $inf;
>          $inf = gensym();
> -
> -        for (@ibase) {
> -            open($inf, "<" . $_ . "/" . $1) and next INF;
> +        $file = postprocess($1);
> +
> +        # Try cwd and $ibase, then explicit -I paths.
> +        $done = 0;
> +        foreach $path ("", $ibase, @ipath) {
> +            $mypath = $file;
> +            $mypath = $path . "/" . $mypath if ($path ne "");
> +            open($inf, "<" . $mypath) and ($done = 1, last);
>          }
> -        die "cannot open $1: $!\n";
> +        die "cannot find $file" if !$done;
> +        next;
>      };

Again, please add the original commit messages so I (and future
contributors) don't have to fetch gcc logs.
-- 
FFmpeg = Fantastic and Fucking Moronic Ponderous Erotic Gospel


More information about the ffmpeg-devel mailing list