autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fix autoscan to not search config-subdirs


From: Ralf Wildenhues
Subject: Re: Fix autoscan to not search config-subdirs
Date: Mon, 3 Apr 2006 05:48:59 +0200
User-agent: Mutt/1.5.9i

Hi Noah,

THanks for review and patch!

* Noah Misch wrote on Fri, Mar 31, 2006 at 03:34:55PM CEST:
> On Tue, Mar 28, 2006 at 09:47:39PM +0200, Ralf Wildenhues wrote:
> 
> > +  $subdir_regex = join ('|', map { quotemeta } @subdir);
> 
> As a matter of "Perl Fu", I would build a hash with subdir-name keys rather 
> than
> a regexp, for this purpose.

Yes, I guess.

> Would it be better to exclude subtrees bearing evidence of a configuration
> mechanism [configure(\.(ac|in|gnu))]?  Proposed alternate patch below; what do
> you think?  It probably mistreats packages that use Cygnus `configure'.  Do 
> any
> packages in active development or use continue to use that?

If so, they are old enough probably not to need to use autoscan.
I'm happy with your patch, besides a small issue noted below.

Cheers,
Ralf

> 2006-03-31  Noah Misch  <address@hidden>
> 
>       * bin/autoscan.in (subdirs): New global.
>       (scan_file): Prune directories with configure{,.{ac,in,gnu}}.
>       (output): Emit AC_CONFIG_SUBDIRS as needed.
>       * tests/autoscan.at (autoscan): Remove XFAIL.
> 
> Only in ac-an_subdirs: ac100-an_subdirs_2.patch
> diff -urp -X dontdiff ac-clean/bin/autoscan.in ac-an_subdirs/bin/autoscan.in
> --- ac-clean/bin/autoscan.in  2006-03-26 16:27:56.000000000 -0500
> +++ ac-an_subdirs/bin/autoscan.in     2006-03-31 08:20:26.000000000 -0500
> @@ -47,7 +47,7 @@ use File::Basename;
>  use File::Find;
>  use strict;
>  
> -use vars qw(@cfiles @makefiles @shfiles %printed);
> +use vars qw(@cfiles @makefiles @shfiles @subdirs %printed);
>  
>  # The kind of the words we are looking for.
>  my @kinds = qw (function header identifier program
> @@ -385,6 +385,15 @@ sub scan_file ()
>    # Strip a useless leading `./'.
>    $File::Find::name =~ s,^\./,,;
>  
> +  if (-d $_ and

You should make sure `.' is excluded here, otherwise autoscan won't
recurse into any subdirs if a configure.ac is already present.

> +      -f "$_/configure.in"  ||
> +      -f "$_/configure.ac"  ||
> +      -f "$_/configure.gnu" ||
> +      -f "$_/configure")
> +    {
> +      $File::Find::prune = 1;
> +      push @subdirs, $File::Find::name;
> +    }
>    if (/\.[chlym](\.in)?$/)
>      {
>        used 'program', 'cc', $File::Find::name;
*snip*




reply via email to

[Prev in Thread] Current Thread [Next in Thread]