GNU bug report logs - #7819
automake does not really automatically distribute all the files it's advertised to.

Previous Next

Package: automake;

Reported by: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Date: Mon, 10 Jan 2011 19:46:01 UTC

Severity: normal

Tags: patch

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7819 in the body.
You can then email your comments to 7819 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7819; Package automake. (Mon, 10 Jan 2011 19:46:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefano Lattarini <stefano.lattarini <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Mon, 10 Jan 2011 19:46:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: bug-automake <at> gnu.org
Subject: automake does not really automatically distribute all the files it's
	advertised to.
Date: Mon, 10 Jan 2011 20:50:13 +0100
Hello automakers.

From the automake manual, section 14.1 "Basics of Distribution":

 ``Automake also has a built-in list of commonly used files that are
   automatically included if they are found in the current directory
   (either physically, or as the target of a Makefile.am rule). This
   list is printed by "automake --help". ''

And here is the current list of files automake should distribute
automatically:

  $ automake --help
  Usage: /usr/bin/automake [OPTION] ... [Makefile]...
  ...
  Files which are automatically distributed, if found:
    ABOUT-GNU           README              config.rpath        ltcf-gcj.sh
    ABOUT-NLS           THANKS              config.sub          ltconfig
    AUTHORS             TODO                configure           ltmain.sh
    BACKLOG             acconfig.h          configure.ac        mdate-sh
    COPYING             aclocal.m4          configure.in        missing
    COPYING.DOC         ansi2knr.1          depcomp             mkinstalldirs
    COPYING.LESSER      ansi2knr.c          elisp-comp          py-compile
    COPYING.LIB         compile             install-sh          stamp-vti
    ChangeLog           config.guess        libversion.in       texinfo.tex
    INSTALL             config.h.bot        ltcf-c.sh           ylwrap
    NEWS                config.h.top        ltcf-cxx.sh
  ...

But the above is not always correct, as some of these files are distributed
*only* if other conditions are met.  For example, acconfig.h and aclocal.m4
are distributed only if they really exists at automake runtime (having them
as targets in Makefile.am won't work), config.h.bot and config.h.top are
distributed only if the AC_CONFIG_HEADERS macro is used, and stamp-vti is
distributed only if info_TEXINFOS and version.texi are used.

So, either the automake script or the automake help screen should be
adjusted.

IMHO the current behaviour of automake is good enough, so I think we
should adjust the automake help screen to read something like:

   Files automatically distributed if found:
     ...

   Files automatically distributed if found (under certain conditions):
     ...

I will attempt a patch soonish (I already have half-cooked testcases,
and the relevant code in automake.in seems quite clear); but as usual,
having the issue registered in the bug tracker "JFTR" won't hurt.

Regards,
  Stefano




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7819; Package automake. (Mon, 10 Jan 2011 20:05:02 GMT) Full text and rfc822 format available.

Message #8 received at 7819 <at> debbugs.gnu.org (full text, mbox):

From: Peter Rosin <peda <at> lysator.liu.se>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: 7819 <at> debbugs.gnu.org
Subject: Re: bug#7819: automake does not really automatically distribute all
	the	files it's advertised to.
Date: Mon, 10 Jan 2011 21:11:51 +0100
Den 2011-01-10 20:50 skrev Stefano Lattarini:
> Hello automakers.
> 
> From the automake manual, section 14.1 "Basics of Distribution":
> 
>  ``Automake also has a built-in list of commonly used files that are
>    automatically included if they are found in the current directory
>    (either physically, or as the target of a Makefile.am rule). This
>    list is printed by "automake --help". ''
> 
> And here is the current list of files automake should distribute
> automatically:
> 
>   $ automake --help
>   Usage: /usr/bin/automake [OPTION] ... [Makefile]...
>   ...
>   Files which are automatically distributed, if found:
>     ABOUT-GNU           README              config.rpath        ltcf-gcj.sh
>     ABOUT-NLS           THANKS              config.sub          ltconfig
>     AUTHORS             TODO                configure           ltmain.sh
>     BACKLOG             acconfig.h          configure.ac        mdate-sh
>     COPYING             aclocal.m4          configure.in        missing
>     COPYING.DOC         ansi2knr.1          depcomp             mkinstalldirs
>     COPYING.LESSER      ansi2knr.c          elisp-comp          py-compile
>     COPYING.LIB         compile             install-sh          stamp-vti
>     ChangeLog           config.guess        libversion.in       texinfo.tex
>     INSTALL             config.h.bot        ltcf-c.sh           ylwrap
>     NEWS                config.h.top        ltcf-cxx.sh
>   ...
> 

ar-lib is missing (perhaps because it's not in the branch you tested?).

Cheers,
Peter




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7819; Package automake. (Mon, 10 Jan 2011 20:16:01 GMT) Full text and rfc822 format available.

Message #11 received at 7819 <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: Peter Rosin <peda <at> lysator.liu.se>
Cc: 7819 <at> debbugs.gnu.org
Subject: Re: bug#7819: automake does not really automatically distribute all
	the files it's advertised to.
Date: Mon, 10 Jan 2011 21:20:33 +0100
On Monday 10 January 2011, Peter Rosin wrote:
> Den 2011-01-10 20:50 skrev Stefano Lattarini:
> > Hello automakers.
> > 
> > From the automake manual, section 14.1 "Basics of Distribution":
> > 
> >  ``Automake also has a built-in list of commonly used files that are
> >    automatically included if they are found in the current directory
> >    (either physically, or as the target of a Makefile.am rule). This
> >    list is printed by "automake --help". ''
> > 
> > And here is the current list of files automake should distribute
> > automatically:
> > 
> >   $ automake --help
> >   Usage: /usr/bin/automake [OPTION] ... [Makefile]...
> >   ...
> >   Files which are automatically distributed, if found:
> >     ABOUT-GNU           README              config.rpath        ltcf-gcj.sh
> >     ABOUT-NLS           THANKS              config.sub          ltconfig
> >     AUTHORS             TODO                configure           ltmain.sh
> >     BACKLOG             acconfig.h          configure.ac        mdate-sh
> >     COPYING             aclocal.m4          configure.in        missing
> >     COPYING.DOC         ansi2knr.1          depcomp             mkinstalldirs
> >     COPYING.LESSER      ansi2knr.c          elisp-comp          py-compile
> >     COPYING.LIB         compile             install-sh          stamp-vti
> >     ChangeLog           config.guess        libversion.in       texinfo.tex
> >     INSTALL             config.h.bot        ltcf-c.sh           ylwrap
> >     NEWS                config.h.top        ltcf-cxx.sh
> >   ...
> > 
> 
> ar-lib is missing (perhaps because it's not in the branch you tested?).
>
I guess so, as I tested only with the maint branch.

Anyway, the testcase I'm preparing takes the list of automatically-distributed
files from automake's own help screen, and thus should remain automatically in
sync with what is documented there.

Regards,
   Stefano




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7819; Package automake. (Mon, 10 Jan 2011 20:37:02 GMT) Full text and rfc822 format available.

Message #14 received at 7819 <at> debbugs.gnu.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: 7819 <at> debbugs.gnu.org
Subject: Re: bug#7819: automake does not really automatically distribute all
	the files it's advertised to.
Date: Mon, 10 Jan 2011 21:44:22 +0100
Hi Stefano,

* Stefano Lattarini wrote on Mon, Jan 10, 2011 at 08:50:13PM CET:
>   Files which are automatically distributed, if found:
>     ABOUT-GNU           README              config.rpath        ltcf-gcj.sh
>     ABOUT-NLS           THANKS              config.sub          ltconfig
>     AUTHORS             TODO                configure           ltmain.sh
>     BACKLOG             acconfig.h          configure.ac        mdate-sh
[...]
>   ...
> 
> But the above is not always correct, as some of these files are distributed
> *only* if other conditions are met.  For example, acconfig.h and aclocal.m4
> are distributed only if they really exists at automake runtime (having them
> as targets in Makefile.am won't work), config.h.bot and config.h.top are
> distributed only if the AC_CONFIG_HEADERS macro is used, and stamp-vti is
> distributed only if info_TEXINFOS and version.texi are used.
> 
> So, either the automake script or the automake help screen should be
> adjusted.
> 
> IMHO the current behaviour of automake is good enough, so I think we
> should adjust the automake help screen to read something like:

Agreed.  With many of the names, I have been wondering though whether we
should distribute them at all in arbitrary directories.  For example,
most scripts don't make that much sense outside of the toplevel or the
build-aux directories.

Then again, changing the current behavior here is quite likely to break
some existing package setups, and even silently and only upon 'make
dist' (so it might never show up for the developer), so that I'm not
inclined to change this lightly.

Documenting the existing behavior better sounds like a good idea to me.

Thanks for the report,
Ralf




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7819; Package automake. (Mon, 10 Jan 2011 21:43:02 GMT) Full text and rfc822 format available.

Message #17 received at 7819 <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
Cc: 7819 <at> debbugs.gnu.org
Subject: Re: bug#7819: automake does not really automatically distribute all
	the files it's advertised to.
Date: Mon, 10 Jan 2011 22:40:13 +0100
On Monday 10 January 2011, Ralf Wildenhues wrote:
> Hi Stefano,
> 
> * Stefano Lattarini wrote on Mon, Jan 10, 2011 at 08:50:13PM CET:
> >   Files which are automatically distributed, if found:
> >     ABOUT-GNU           README              config.rpath        ltcf-gcj.sh
> >     ABOUT-NLS           THANKS              config.sub          ltconfig
> >     AUTHORS             TODO                configure           ltmain.sh
> >     BACKLOG             acconfig.h          configure.ac        mdate-sh
> [...]
> >   ...
> > 
> > But the above is not always correct, as some of these files are distributed
> > *only* if other conditions are met.  For example, acconfig.h and aclocal.m4
> > are distributed only if they really exists at automake runtime (having them
> > as targets in Makefile.am won't work), config.h.bot and config.h.top are
> > distributed only if the AC_CONFIG_HEADERS macro is used, and stamp-vti is
> > distributed only if info_TEXINFOS and version.texi are used.
> > 
> > So, either the automake script or the automake help screen should be
> > adjusted.
> > 
> > IMHO the current behaviour of automake is good enough, so I think we
> > should adjust the automake help screen to read something like:
> 
> Agreed.  With many of the names, I have been wondering though whether we
> should distribute them at all in arbitrary directories.  For example,
> most scripts don't make that much sense outside of the toplevel or the
> build-aux directories.
>
Ouch.  I thought that the files listed above were distributed only when
found in the top-level directory, but now I see that they are in fact
distributed if found in the same directory of the being-processed
Makefile.am (and this is even documented, albeit not very clearly).

Maybe we should deprecate this behaviour in the manual, add an XFAILing
testcase, and change the behaviour after the next release.  But then
you say ...

> Then again, changing the current behavior here is quite likely to break
> some existing package setups, and even silently and only upon 'make
> dist' (so it might never show up for the developer), so that I'm not
> inclined to change this lightly.
>
Oh, OK.  Your call -- I won't push you in any direction about this issue.

> Documenting the existing behavior better sounds like a good idea to me.
>
> Thanks for the report,
> Ralf
> 

Thanks,
   Stefano




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7819; Package automake. (Tue, 11 Jan 2011 19:46:01 GMT) Full text and rfc822 format available.

Message #20 received at 7819 <at> debbugs.gnu.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: 7819 <at> debbugs.gnu.org
Subject: Re: bug#7819: automake does not really automatically distribute all
	the files it's advertised to.
Date: Tue, 11 Jan 2011 20:53:05 +0100
* Stefano Lattarini wrote on Mon, Jan 10, 2011 at 10:40:13PM CET:
> On Monday 10 January 2011, Ralf Wildenhues wrote:
> > * Stefano Lattarini wrote on Mon, Jan 10, 2011 at 08:50:13PM CET:
> > > But the above is not always correct, as some of these files are distributed
> > > *only* if other conditions are met.  For example, acconfig.h and aclocal.m4
> > > are distributed only if they really exists at automake runtime (having them
> > > as targets in Makefile.am won't work),

I didn't fully realize this when reading it last time.  That's an ugly
inconsistency.  :-/  Luckily most of these are typically not generated
only after automake (still; see e.g., ChangeLog, THANKS, in coreutils).

More generally though, I get suspicious for any external stuff which
influences the result of 'automake', because it makes writing rebuild
rules harder or impossible.  These automatically-distributed files can
cause build or distribution problems for projects which embed optional
subprojects (and try to share files, for example).  There has been a
report to this end not too long ago, I think, but we've seen more than
just one.

But even just having a distribution "magically" fixed by rerunning
'automake' (after all files are in place) is very unintuitive, and
has been source for questions from users.

> > Agreed.  With many of the names, I have been wondering though whether we
> > should distribute them at all in arbitrary directories.  For example,
> > most scripts don't make that much sense outside of the toplevel or the
> > build-aux directories.
> >
> Ouch.  I thought that the files listed above were distributed only when
> found in the top-level directory, but now I see that they are in fact
> distributed if found in the same directory of the being-processed
> Makefile.am (and this is even documented, albeit not very clearly).
> 
> Maybe we should deprecate this behaviour in the manual, add an XFAILing
> testcase, and change the behaviour after the next release.  But then
> you say ...
> 
> > Then again, changing the current behavior here is quite likely to break
> > some existing package setups, and even silently and only upon 'make
> > dist' (so it might never show up for the developer), so that I'm not
> > inclined to change this lightly.
> >
> Oh, OK.  Your call -- I won't push you in any direction about this issue.

Well, I must confess I'm not totally sure on this one.  For the
documentation files (README, ChangeLog, ...) it would probably make
sense to do so though.  Hmm.

Cheers,
Ralf




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7819; Package automake. (Sat, 15 Jan 2011 20:04:02 GMT) Full text and rfc822 format available.

Message #23 received at 7819 <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: automake-patches <at> gnu.org
Cc: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>, 7819 <at> debbugs.gnu.org
Subject: Re: bug#7819: automake does not really automatically distribute all
	the files it's advertised to.
Date: Sat, 15 Jan 2011 21:09:35 +0100
[Message part 1 (text/plain, inline)]
Reference:
 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7819>

On Monday 10 January 2011, Ralf Wildenhues wrote:
> Hi Stefano,
> 
> * Stefano Lattarini wrote on Mon, Jan 10, 2011 at 08:50:13PM CET:
> >   Files which are automatically distributed, if found:
> >     ABOUT-GNU           README              config.rpath        ltcf-gcj.sh
> >     ABOUT-NLS           THANKS              config.sub          ltconfig
> >     AUTHORS             TODO                configure           ltmain.sh
> >     BACKLOG             acconfig.h          configure.ac        mdate-sh
> [...]
> >   ...
> > 
> > But the above is not always correct, as some of these files are distributed
> > *only* if other conditions are met.  For example, acconfig.h and aclocal.m4
> > are distributed only if they really exists at automake runtime (having them
> > as targets in Makefile.am won't work), config.h.bot and config.h.top are
> > distributed only if the AC_CONFIG_HEADERS macro is used, and stamp-vti is
> > distributed only if info_TEXINFOS and version.texi are used.
> > 
> > So, either the automake script or the automake help screen should be
> > adjusted.
> > 
> > IMHO the current behaviour of automake is good enough, so I think we
> > should adjust the automake help screen to read something like:
> 
> Agreed.  With many of the names, I have been wondering though whether we
> should distribute them at all in arbitrary directories.  For example,
> most scripts don't make that much sense outside of the toplevel or the
> build-aux directories.
> 
> Then again, changing the current behavior here is quite likely to break
> some existing package setups, and even silently and only upon 'make
> dist' (so it might never show up for the developer), so that I'm not
> inclined to change this lightly.
> 
> Documenting the existing behavior better sounds like a good idea to me.
> 
> Thanks for the report,
> Ralf
>

The attached two-patch series should fix the bug, by making it clear
in the documentation and in the help screen that certain files are
automatically distributed only under certain conditions or in certain
situations (without fully specifying which conditions or situations,
as that would be too detailed IMHO and make suboptimal behaviour
more difficult to be changed in future).

OK for maint?

Regards,
   Stefano

-*-*-

refactor: split 'usage' subroutine in automake

This change is related to automake bug#7819.

* automake.in (print_autodist_files): New subroutine,
extracted from ...
(usage): ... this, which now uses it.
* tests/autodist-no-duplicate.test: New test.
* tests/Makefile.am (TESTS): Update.
---
 ChangeLog                        |   10 ++++
 automake.in                      |   89 +++++++++++++++++++-------------------
 tests/Makefile.am                |    1 +
 tests/Makefile.in                |    1 +
 tests/autodist-no-duplicate.test |   40 +++++++++++++++++
 5 files changed, 97 insertions(+), 44 deletions(-)
 create mode 100755 tests/autodist-no-duplicate.test

-*-*-

help: improve text about automatically-distributed files

This change fixes automake bug#7819.

* automake.in (usage): Distinguish between files that are always
automatically distributed when found, and those which are only
"under certain conditions".
* doc/automake.texi (Basics of Distribution): Update accordingly.
* tests/autodist-subdir.test: Update.
* tests/autodist-no-duplicate.test: Likewise.
* tests/autodist.test: Likewise.
(configure.in): Remove useless call to AM_MAINTAINER_MODE.
---
 ChangeLog                        |   11 +++++++++++
 automake.in                      |    8 ++++++--
 doc/automake.texi                |    4 +++-
 tests/autodist-no-duplicate.test |   32 +++++++++++++++++++++-----------
 tests/autodist-subdir.test       |   27 +--------------------------
 tests/autodist.test              |   29 +----------------------------
 6 files changed, 43 insertions(+), 68 deletions(-)

[0001-refactor-split-usage-subroutine-in-automake.patch (text/x-patch, inline)]
From 486824c88082cc9d9a66dfce3eb5a8e793669f5f Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Date: Wed, 12 Jan 2011 01:06:33 +0100
Subject: [PATCH 1/2] refactor: split 'usage' subroutine in automake

This change is related to automake bug#7819.

* automake.in (print_autodist_files): New subroutine,
extracted from ...
(usage): ... this, which now uses it.
* tests/autodist-no-duplicate.test: New test.
* tests/Makefile.am (TESTS): Update.
---
 ChangeLog                        |   10 ++++
 automake.in                      |   89 +++++++++++++++++++-------------------
 tests/Makefile.am                |    1 +
 tests/Makefile.in                |    1 +
 tests/autodist-no-duplicate.test |   40 +++++++++++++++++
 5 files changed, 97 insertions(+), 44 deletions(-)
 create mode 100755 tests/autodist-no-duplicate.test

diff --git a/ChangeLog b/ChangeLog
index be35937..4e1e093 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-01-15   Stefano Lattarini  <stefano.lattarini <at> gmail.com>
+
+	refactor: split 'usage' subroutine in automake
+	This change is related to automake bug#7819.
+	* automake.in (print_autodist_files): New subroutine,
+	extracted from ...
+	(usage): ... this, which now uses it.
+	* tests/autodist-no-duplicate.test: New test.
+	* tests/Makefile.am (TESTS): Update.
+
 2011-01-15  Ralf Wildenhues  <Ralf.Wildenhues <at> gmx.de>
 
 	docs: ensure example are separated with empty lines in the input
diff --git a/automake.in b/automake.in
index d56fbf7..3a214e0 100755
--- a/automake.in
+++ b/automake.in
@@ -8308,6 +8308,50 @@ sub generate_makefile ($$)
 
 ################################################################
 
+# Helper function for usage().
+sub print_autodist_files (@)
+{
+  my @lcomm = sort (&uniq (@_));
+
+  my @four;
+  format USAGE_FORMAT =
+  @<<<<<<<<<<<<<<<<   @<<<<<<<<<<<<<<<<   @<<<<<<<<<<<<<<<<   @<<<<<<<<<<<<<<<<
+  $four[0],           $four[1],           $four[2],           $four[3]
+.
+  local $~ = "USAGE_FORMAT";
+
+  my $cols = 4;
+  my $rows = int(@lcomm / $cols);
+  my $rest = @lcomm % $cols;
+
+  if ($rest)
+    {
+      $rows++;
+    }
+  else
+    {
+      $rest = $cols;
+    }
+
+  for (my $y = 0; $y < $rows; $y++)
+    {
+      @four = ("", "", "", "");
+      for (my $x = 0; $x < $cols; $x++)
+        {
+          last if $y + 1 == $rows && $x == $rest;
+
+          my $idx = (($x > $rest)
+      	       ?  ($rows * $rest + ($rows - 1) * ($x - $rest))
+      	       : ($rows * $x));
+
+          $idx += $y;
+          $four[$x] = $lcomm[$idx];
+        }
+      write;
+    }
+}
+
+
 # Print usage information.
 sub usage ()
 {
@@ -8341,51 +8385,8 @@ Library files:
 ";
     Automake::ChannelDefs::usage;
 
-    my ($last, @lcomm);
-    $last = '';
-    foreach my $iter (sort ((@common_files, @common_sometimes)))
-    {
-	push (@lcomm, $iter) unless $iter eq $last;
-	$last = $iter;
-    }
-
-    my @four;
     print "\nFiles which are automatically distributed, if found:\n";
-    format USAGE_FORMAT =
-  @<<<<<<<<<<<<<<<<   @<<<<<<<<<<<<<<<<   @<<<<<<<<<<<<<<<<   @<<<<<<<<<<<<<<<<
-  $four[0],           $four[1],           $four[2],           $four[3]
-.
-    $~ = "USAGE_FORMAT";
-
-    my $cols = 4;
-    my $rows = int(@lcomm / $cols);
-    my $rest = @lcomm % $cols;
-
-    if ($rest)
-    {
-	$rows++;
-    }
-    else
-    {
-	$rest = $cols;
-    }
-
-    for (my $y = 0; $y < $rows; $y++)
-    {
-	@four = ("", "", "", "");
-	for (my $x = 0; $x < $cols; $x++)
-	{
-	    last if $y + 1 == $rows && $x == $rest;
-
-	    my $idx = (($x > $rest)
-		       ?  ($rows * $rest + ($rows - 1) * ($x - $rest))
-		       : ($rows * $x));
-
-	    $idx += $y;
-	    $four[$x] = $lcomm[$idx];
-	}
-	write;
-    }
+    print_autodist_files (@common_files, @common_sometimes);
 
     print '
 Report bugs to <@PACKAGE_BUGREPORT@>.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 890e69b..63ad4d9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -101,6 +101,7 @@ autodist-acconfig-no-subdir.test \
 autodist-aclocal-m4.test \
 autodist-config-headers.test \
 autodist-configure-no-subdir.test \
+autodist-no-duplicate.test \
 autodist-stamp-vti.test \
 autohdr.test \
 autohdr2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 7600c14..0f88916 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -368,6 +368,7 @@ autodist-acconfig-no-subdir.test \
 autodist-aclocal-m4.test \
 autodist-config-headers.test \
 autodist-configure-no-subdir.test \
+autodist-no-duplicate.test \
 autodist-stamp-vti.test \
 autohdr.test \
 autohdr2.test \
diff --git a/tests/autodist-no-duplicate.test b/tests/autodist-no-duplicate.test
new file mode 100755
index 0000000..e2b7da0
--- /dev/null
+++ b/tests/autodist-no-duplicate.test
@@ -0,0 +1,40 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that there are no duplicates in the list of files automatically
+# distributed by automake.
+
+. ./defs || Exit 1
+
+set -e
+
+# The automake manual states that the list of automatically-distributed
+# files should be given by `automake --help'.
+list=`$AUTOMAKE --help \
+        | sed -n '/^Files .*automatically distributed.*if found/,/^ *$/p' \
+        | sed 1d`
+
+list=`echo $list`
+test -n "$list" # sanity check
+
+for f in $list; do echo $f; done | sort > files.lst
+uniq files.lst > files.uniq
+
+cat files.lst
+cat files.uniq
+diff files.lst files.uniq
+
+:
-- 
1.7.2.3

[0002-help-improve-text-about-automatically-distributed-fi.patch (text/x-patch, inline)]
From 60370a87d28b0c3e7ddddc24c7da904a69b71d5b Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Date: Wed, 12 Jan 2011 01:27:07 +0100
Subject: [PATCH 2/2] help: improve text about automatically-distributed files

This change fixes automake bug#7819.

* automake.in (usage): Distinguish between files that are always
automatically distributed when found, and those which are only
"under certain conditions".
* doc/automake.texi (Basics of Distribution): Update accordingly.
* tests/autodist-subdir.test: Update.
* tests/autodist-no-duplicate.test: Likewise.
* tests/autodist.test: Likewise.
(configure.in): Remove useless call to AM_MAINTAINER_MODE.
---
 ChangeLog                        |   11 +++++++++++
 automake.in                      |    8 ++++++--
 doc/automake.texi                |    4 +++-
 tests/autodist-no-duplicate.test |   32 +++++++++++++++++++++-----------
 tests/autodist-subdir.test       |   27 +--------------------------
 tests/autodist.test              |   29 +----------------------------
 6 files changed, 43 insertions(+), 68 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4e1e093..b532fcf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2011-01-15   Stefano Lattarini  <stefano.lattarini <at> gmail.com>
 
+	help: improve text about automatically-distributed files
+	This change fixes automake bug#7819.
+	* automake.in (usage): Distinguish between files that are always
+	automatically distributed when found, and those which are only
+	"under certain conditions".
+	* doc/automake.texi (Basics of Distribution): Update accordingly.
+	* tests/autodist-subdir.test: Update.
+	* tests/autodist-no-duplicate.test: Likewise.
+	* tests/autodist.test: Likewise.
+	(configure.in): Remove useless call to AM_MAINTAINER_MODE.
+
 	refactor: split 'usage' subroutine in automake
 	This change is related to automake bug#7819.
 	* automake.in (print_autodist_files): New subroutine,
diff --git a/automake.in b/automake.in
index 3a214e0..2603e44 100755
--- a/automake.in
+++ b/automake.in
@@ -8385,8 +8385,12 @@ Library files:
 ";
     Automake::ChannelDefs::usage;
 
-    print "\nFiles which are automatically distributed, if found:\n";
-    print_autodist_files (@common_files, @common_sometimes);
+    print "\nFiles automatically distributed if found " .
+          "(always):\n";
+    print_autodist_files @common_files;
+    print "\nFiles automatically distributed if found " .
+          "(under certain conditions):\n";
+    print_autodist_files @common_sometimes;
 
     print '
 Report bugs to <@PACKAGE_BUGREPORT@>.
diff --git a/doc/automake.texi b/doc/automake.texi
index 73c0e51..cb1445f 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8289,7 +8289,9 @@ as are all @file{Makefile.am}s and @file{Makefile.in}s.  Automake also
 has a built-in list of commonly used files that are automatically
 included if they are found in the current directory (either physically,
 or as the target of a @file{Makefile.am} rule).  This list is printed by
-@samp{automake --help}.  Also, files that are read by @command{configure}
+@samp{automake --help}@footnote{Note that some of these files are actually
+distributed only when other certain conditions hold}.  Also, files that
+are read by @command{configure}
 (i.e.@: the source files corresponding to the files specified in various
 Autoconf macros such as @code{AC_CONFIG_FILES} and siblings) are
 automatically distributed.  Files included in @file{Makefile.am}s (using
diff --git a/tests/autodist-no-duplicate.test b/tests/autodist-no-duplicate.test
index e2b7da0..65fe034 100755
--- a/tests/autodist-no-duplicate.test
+++ b/tests/autodist-no-duplicate.test
@@ -21,20 +21,30 @@
 
 set -e
 
+re='Files .*automatically distributed.*if found'
+
 # The automake manual states that the list of automatically-distributed
 # files should be given by `automake --help'.
-list=`$AUTOMAKE --help \
-        | sed -n '/^Files .*automatically distributed.*if found/,/^ *$/p' \
+list1=`$AUTOMAKE --help \
+        | sed -n "/^$re.*always/,/^ *$/p" \
         | sed 1d`
+list1=`echo $list1`
 
-list=`echo $list`
-test -n "$list" # sanity check
-
-for f in $list; do echo $f; done | sort > files.lst
-uniq files.lst > files.uniq
-
-cat files.lst
-cat files.uniq
-diff files.lst files.uniq
+list2=`$AUTOMAKE --help \
+        | sed -n "/^$re.*under certain conditions/,/^ *$/p" \
+        | sed 1d`
+list2=`echo $list2`
+
+# Sanity checks.
+test -n "$list1"
+test -n "$list2"
+
+for i in 1 2; do
+  eval "for f in \${list$i}; do echo \$f; done | sort > files$i.lst"
+  uniq files$i.lst > files$i.uniq
+  cat files$i.lst
+  cat files$i.uniq
+  diff files$i.lst files$i.uniq
+done
 
 :
diff --git a/tests/autodist-subdir.test b/tests/autodist-subdir.test
index db694f8..83b293e 100755
--- a/tests/autodist-subdir.test
+++ b/tests/autodist-subdir.test
@@ -39,33 +39,8 @@ $AUTOCONF
 # The automake manual states that the list of automatically-distributed
 # files should be given by `automake --help'.
 list=`$AUTOMAKE --help \
-        | sed -n '/^Files .*automatically distributed.*if found/,/^ *$/p' \
+        | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
         | sed 1d`
-list=`for f in $list; do
-        case $f in
-          configure|configure.in|configure.ac)
-            # See test 'autodist-configure-no-subdir.test'.
-            ;;
-          aclocal.m4)
-            # This file should be distributed only when it is a real
-            # dependency for configure.  Anyway, not a check to be
-            # performed in this test.
-            ;;
-          acconfig.h)
-            # Works only when it really exists, not when it is a
-            # target in Makefile.am.
-            ;;
-          stamp-vti)
-            # Works only when using info_TEXINFOS and version.texi.
-            ;;
-          config.h.bot|config.h.top)
-            # Works only when the AC_CONFIG_HADERS macro is used.
-            ;;
-          *)
-            echo $f
-            ;;
-        esac
-      done`
 # Normalize whitespace, just in case.
 list=`echo $list`
 
diff --git a/tests/autodist.test b/tests/autodist.test
index 34b9526..7992608 100755
--- a/tests/autodist.test
+++ b/tests/autodist.test
@@ -32,8 +32,6 @@ cat > configure.in <<END
 AC_INIT([$me], [1.0])
 AC_CONFIG_AUX_DIR([.])
 AM_INIT_AUTOMAKE
-## Will avoid useless regeneration of aclocal.m4, configure, etc.
-AM_MAINTAINER_MODE
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
 END
@@ -44,33 +42,8 @@ $AUTOCONF
 # The automake manual states that the list of automatically-distributed
 # files should be given by `automake --help'.
 list=`$AUTOMAKE --help \
-        | sed -n '/^Files .*automatically distributed.*if found/,/^ *$/p' \
+        | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
         | sed 1d`
-list=`for f in $list; do
-        case $f in
-          configure|configure.in|configure.ac)
-            # See test 'autodist-configure-no-subdir.test'.
-            ;;
-          aclocal.m4)
-            # This file should be distributed only when it is a real
-            # dependency for configure.  Anyway, not a check to be
-            # performed in this test.
-            ;;
-          acconfig.h)
-            # Works only when it really exists, not when it is a
-            # target in Makefile.am.
-            ;;
-          stamp-vti)
-            # Works only when using info_TEXINFOS and version.texi.
-            ;;
-          config.h.bot|config.h.top)
-            # Works only when the AC_CONFIG_HADERS macro is used.
-            ;;
-          *)
-            echo $f
-            ;;
-        esac
-      done`
 # Normalize whitespace, just in case.
 list=`echo $list`
 
-- 
1.7.2.3


Added tag(s) patch. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 19 Jan 2011 16:19:01 GMT) Full text and rfc822 format available.

Reply sent to Stefano Lattarini <stefano.lattarini <at> gmail.com>:
You have taken responsibility. (Thu, 23 Jun 2011 09:03:02 GMT) Full text and rfc822 format available.

Notification sent to Stefano Lattarini <stefano.lattarini <at> gmail.com>:
bug acknowledged by developer. (Thu, 23 Jun 2011 09:03:02 GMT) Full text and rfc822 format available.

Message #30 received at 7819-done <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: automake-patches <at> gnu.org
Cc: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>, 7819-done <at> debbugs.gnu.org
Subject: Re: bug#7819: automake does not really automatically distribute all
	the files it's advertised to.
Date: Thu, 23 Jun 2011 11:02:29 +0200
References:
  <http://lists.gnu.org/archive/html/automake-patches/2011-01/msg00181.html>
  <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7819>

On Saturday 15 January 2011, Stefano Lattarini wrote:
> 
> On Monday 10 January 2011, Ralf Wildenhues wrote:
> > Hi Stefano,
> > 
> > * Stefano Lattarini wrote on Mon, Jan 10, 2011 at 08:50:13PM CET:
> > >   Files which are automatically distributed, if found:
> > >     ABOUT-GNU           README              config.rpath        ltcf-gcj.sh
> > >     ABOUT-NLS           THANKS              config.sub          ltconfig
> > >     AUTHORS             TODO                configure           ltmain.sh
> > >     BACKLOG             acconfig.h          configure.ac        mdate-sh
> > [...]
> > >   ...
> > > 
> > > But the above is not always correct, as some of these files are distributed
> > > *only* if other conditions are met.  For example, acconfig.h and aclocal.m4
> > > are distributed only if they really exists at automake runtime (having them
> > > as targets in Makefile.am won't work), config.h.bot and config.h.top are
> > > distributed only if the AC_CONFIG_HEADERS macro is used, and stamp-vti is
> > > distributed only if info_TEXINFOS and version.texi are used.
> > > 
> > > So, either the automake script or the automake help screen should be
> > > adjusted.
> > > 
> > > IMHO the current behaviour of automake is good enough, so I think we
> > > should adjust the automake help screen to read something like:
> > 
> > Agreed.  With many of the names, I have been wondering though whether we
> > should distribute them at all in arbitrary directories.  For example,
> > most scripts don't make that much sense outside of the toplevel or the
> > build-aux directories.
> > 
> > Then again, changing the current behavior here is quite likely to break
> > some existing package setups, and even silently and only upon 'make
> > dist' (so it might never show up for the developer), so that I'm not
> > inclined to change this lightly.
> > 
> > Documenting the existing behavior better sounds like a good idea to me.
> > 
> > Thanks for the report,
> > Ralf
> >
> 
> The attached two-patch series should fix the bug, by making it clear
> in the documentation and in the help screen that certain files are
> automatically distributed only under certain conditions or in certain
> situations (without fully specifying which conditions or situations,
> as that would be too detailed IMHO and make suboptimal behaviour
> more difficult to be changed in future).
> 
> OK for maint?
> 
> Regards,
>    Stefano
> 
> -*-*-
> 
> refactor: split 'usage' subroutine in automake
> 
> This change is related to automake bug#7819.
> 
> * automake.in (print_autodist_files): New subroutine,
> extracted from ...
> (usage): ... this, which now uses it.
> * tests/autodist-no-duplicate.test: New test.
> * tests/Makefile.am (TESTS): Update.
> ---
>  ChangeLog                        |   10 ++++
>  automake.in                      |   89 +++++++++++++++++++-------------------
>  tests/Makefile.am                |    1 +
>  tests/Makefile.in                |    1 +
>  tests/autodist-no-duplicate.test |   40 +++++++++++++++++
>  5 files changed, 97 insertions(+), 44 deletions(-)
>  create mode 100755 tests/autodist-no-duplicate.test
> 
> -*-*-
> 
> help: improve text about automatically-distributed files
> 
> This change fixes automake bug#7819.
> 
> * automake.in (usage): Distinguish between files that are always
> automatically distributed when found, and those which are only
> "under certain conditions".
> * doc/automake.texi (Basics of Distribution): Update accordingly.
> * tests/autodist-subdir.test: Update.
> * tests/autodist-no-duplicate.test: Likewise.
> * tests/autodist.test: Likewise.
> (configure.in): Remove useless call to AM_MAINTAINER_MODE.
> ---
>  ChangeLog                        |   11 +++++++++++
>  automake.in                      |    8 ++++++--
>  doc/automake.texi                |    4 +++-
>  tests/autodist-no-duplicate.test |   32 +++++++++++++++++++++-----------
>  tests/autodist-subdir.test       |   27 +--------------------------
>  tests/autodist.test              |   29 +----------------------------
>  6 files changed, 43 insertions(+), 68 deletions(-)
> 
>
I've pushed these patches to maint now (after rebasing), and merged
to master.

Regards,
  Stefano




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 21 Jul 2011 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 281 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.