automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-393-g


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-393-gc1040a7
Date: Thu, 23 Jun 2011 09:03:52 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=c1040a74c10a9a011a04ad0d347b61465c5ee194

The branch, maint has been updated
       via  c1040a74c10a9a011a04ad0d347b61465c5ee194 (commit)
       via  9478566087f83d1fac2c9a7629898a3d39a05fdd (commit)
       via  72d36af268fa7bee24466e21d2d543d8d1ce7b1c (commit)
      from  1c3614c6d47b4428c39a784dda7f2641cfc8f6d6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                        |   29 ++++++++++++
 automake.in                      |   95 ++++++++++++++++++++------------------
 doc/automake.texi                |    4 +-
 tests/Makefile.am                |    1 +
 tests/Makefile.in                |    1 +
 tests/autodist-no-duplicate.test |   52 +++++++++++++++++++++
 tests/autodist-subdir.test       |   27 +----------
 tests/autodist.test              |   31 +------------
 8 files changed, 139 insertions(+), 101 deletions(-)
 create mode 100755 tests/autodist-no-duplicate.test

diff --git a/ChangeLog b/ChangeLog
index a05e690..26093d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2011-06-23   Stefano Lattarini  <address@hidden>
+
+       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.
+
+2011-06-23   Stefano Lattarini  <address@hidden>
+
+       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-06-23  Stefano Lattarini  <address@hidden>
+
+       tests: fix bug in 'autodist.test'
+       * tests/autodist.test: Avoid spurious failure due to no
+       `defs-static' file being found in the parent directory.
+
 2011-06-21  Stefano Lattarini  <address@hidden>
 
        maintcheck: extend 'sc_tests_plain_*' checks
diff --git a/automake.in b/automake.in
index 93f4ae4..d0d986e 100755
--- a/automake.in
+++ b/automake.in
@@ -8323,6 +8323,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 ()
 {
@@ -8356,51 +8400,12 @@ 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 "\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 18f65d3..14cf7e6 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8293,7 +8293,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
address@hidden --help}.  Also, files that are read by @command{configure}
address@hidden address@hidden 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/Makefile.am b/tests/Makefile.am
index 28196f8..b14ef77 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -113,6 +113,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 ba57aa2..f9df782 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -390,6 +390,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..81464c0
--- /dev/null
+++ b/tests/autodist-no-duplicate.test
@@ -0,0 +1,52 @@
+#! /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
+
+re='Files .*automatically distributed.*if found'
+
+# The automake manual states that the list of automatically-distributed
+# files should be given by `automake --help'.
+
+list1=`$AUTOMAKE --help \
+        | sed -n "/^$re.*always/,/^ *$/p" \
+        | sed 1d`
+list1=`echo $list1`
+
+list2=`$AUTOMAKE --help \
+        | sed -n "/^$re.*under certain conditions/,/^ *$/p" \
+        | sed 1d`
+list2=`echo $list2`
+
+test -n "$list1"
+test -n "$list2"
+
+st=0
+for i in 1 2; do
+  eval list=\${list$i}
+  for f in $list; 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 || st=1
+done
+
+Exit $st
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..9294bc3 100755
--- a/tests/autodist.test
+++ b/tests/autodist.test
@@ -25,15 +25,13 @@ set -e
 
 # Ensure we are run from the right directory.
 # (The last thing we want is to delete some random user files.)
-test -f ../defs-static
+test -f ../defs
 rm -f *
 
 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`
 


hooks/post-receive
-- 
GNU Automake



reply via email to

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