Hello,
  a month ago I submitted this patch:
http://lists.gnu.org/archive/html/automake-patches/2006-06/msg00000.html

Any opinions?

Stepan Kasal
2006-06-02  Stepan Kasal  <[EMAIL PROTECTED]>

        * automake.in (dist_dirs, fill_dist_dirs): Remove.
        * lib/am/distdir.am (DISTDIRS): Remove.
        * tests/distdir.test, tests/pr2.test: Do not grep, use
        `make distdir' instead.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1621
diff -u -r1.1621 automake.in
--- automake.in 9 Apr 2006 07:46:55 -0000       1.1621
+++ automake.in 24 May 2006 13:45:46 -0000
@@ -489,11 +489,6 @@
 # This holds the set of included files.
 my @include_stack;
 
-# This holds a list of directories which we must create at `dist'
-# time.  This is used in some strange scenarios involving weird
-# AC_OUTPUT commands.
-my %dist_dirs;
-
 # List of dependencies for the obvious targets.
 my @all;
 my @check;
@@ -647,8 +642,6 @@
 
     @include_stack = ();
 
-    %dist_dirs = ();
-
     @all = ();
     @check = ();
     @check_tests = ();
@@ -3527,24 +3520,6 @@
     return $a cmp $b;
 }
 
-# fill_dist_dirs(@FILES)
-# ----------------------
-# Record in %dist_dirs the directory part of any file passed.
-sub fill_dist_dirs (@)
-{
-  my @copy = @_;
-  foreach (@copy)
-    {
-      s/\$\(top_srcdir\)/$topsrcdir/;
-      s/\$\(srcdir\)/./;
-      # Strip any leading `./'.
-      s,^(:?\./+)*,,;
-      next unless s,/+[^/]+$,,;
-      $dist_dirs{$_} = 1
-       unless $_ eq '.';
-    }
-}
-
 # handle_dist
 # -----------
 # Handle 'dist' target.
@@ -3661,26 +3636,10 @@
   # originally, but there were so many requests that I finally
   # relented.
   my $extra_dist = var ('EXTRA_DIST');
-  # FIXME: This should be fixed to work with conditions.  That
-  # will require only making the entries in %dist_dirs under the
-  # appropriate condition.  This is meaningful if the nature of
-  # the distribution should depend upon the configure options
-  # used.
-  fill_dist_dirs ($extra_dist->value_as_list_recursive (skip_ac_subst => 1))
-    if $extra_dist;
-
-  # We have to check DIST_COMMON for extra directories in case the
-  # user put a source used in AC_OUTPUT into a subdir.
-  fill_dist_dirs (rvar ('DIST_COMMON')
-                  ->value_as_list_recursive (skip_ac_subst => 1));
 
   $transform{'DISTCHECK-HOOK'} = !! rule 'distcheck-hook';
   $transform{'GETTEXT'} = $seen_gettext && !$seen_gettext_external;
 
-  # Prepend $(distdir) to each directory given.
-  my %rewritten = map { '$(distdir)/' . "$_" => 1 } keys %dist_dirs;
-  $transform{'DISTDIRS'} = join (' ', sort keys %rewritten);
-
   # If the target `dist-hook' exists, make sure it is run.  This
   # allows users to do random weird things to the distribution
   # before it is packaged up.
@@ -4103,14 +4062,6 @@
 
       my $local = basename ($file);
 
-      # Make sure the dist directory for each input file is created.
-      # We only have to do this at the topmost level though.  This
-      # is a bit ugly but it easier than spreading out the logic,
-      # especially in cases like AC_OUTPUT(foo/out:bar/in), where
-      # there is no Makefile in bar/.
-      fill_dist_dirs (@inputs)
-       if $relative_dir eq '.';
-
       # We skip files that aren't in this directory.  However, if
       # the file's directory does not have a Makefile, and we are
       # currently doing `.', then we create a rule to rebuild the
@@ -4182,13 +4133,6 @@
        {
          my $fd = dirname ($file);
 
-         # Make sure the dist directory for each input file is created.
-         # We only have to do this at the topmost level though.
-         if ($relative_dir eq '.')
-           {
-             $dist_dirs{$fd} = 1;
-           }
-
          # We distribute files that are in this directory.
          # At the top-level (`.') we also distribute files whose
          # directory does not have a Makefile.
Index: lib/am/distdir.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/distdir.am,v
retrieving revision 1.64
diff -u -r1.64 distdir.am
--- lib/am/distdir.am   19 Mar 2006 05:04:28 -0000      1.64
+++ lib/am/distdir.am   24 May 2006 13:45:47 -0000
@@ -53,9 +53,6 @@
        $(am__remove_distdir)
        test -d $(distdir) || mkdir $(distdir)
 endif %?TOPDIR_P%
-##
-##
-?DISTDIRS?     $(mkdir_p) %DISTDIRS%
 ##
 ##
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
Index: tests/distdir.test
===================================================================
RCS file: /cvs/automake/automake/tests/distdir.test,v
retrieving revision 1.10
diff -u -r1.10 distdir.test
--- tests/distdir.test  11 May 2006 17:20:04 -0000      1.10
+++ tests/distdir.test  24 May 2006 13:45:47 -0000
@@ -45,13 +45,21 @@
 mkdir foo woo
 touch foo/bar joe woo/doo dada
 
-grep '\$(mkdir_p).*\.' Makefile.in && exit 1
-grep '\$(mkdir_p).*srcdir' Makefile.in && exit 1
-grep '\$(mkdir_p).*foo' Makefile.in
-
+mkdir build
+cd build
+../configure
+$MAKE distdir
 # Check to make sure `foo' isn't made in build directory.
-grep 'mkdir_p.*foo.*foo' Makefile.in && exit 1
+test -d foo && exit 1
+
+rm -rf distdir-1.0
+mkdir_p='echo mkdir_p' $MAKE -e distdir >make.log || :
+
+grep 'mkdir_p.*\.' make.log && exit 1
+# srcdir is `..', so the above also checks that no directory is created
+# in the source tree.
 
+cd ..
 ./configure --prefix `pwd`
 $MAKE distcheck
 
Index: tests/pr2.test
===================================================================
RCS file: /cvs/automake/automake/tests/pr2.test,v
retrieving revision 1.13
diff -u -r1.13 pr2.test
--- tests/pr2.test      14 May 2005 20:28:55 -0000      1.13
+++ tests/pr2.test      24 May 2006 13:45:48 -0000
@@ -36,8 +36,8 @@
 : > templ/README.foo.in
 
 $ACLOCAL
+$AUTOCONF
 $AUTOMAKE
-
-# Look for mkdir_p invocation for the templ directory.
-# We use the `[^/]' to avoid matching `templ/README.foo.in'.
-$EGREP 'mkdir_p.*templ([^/]|$)' Makefile.in
+./configure
+$MAKE distdir
+test -f nonesuch-nonesuch/templ/README.foo.in

Reply via email to