automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-874-


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-874-g1f2e559
Date: Thu, 23 Jun 2011 09:03:56 +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=1f2e5599a81965c3d7da88995f70455e8fcb8e30

The branch, master has been updated
       via  1f2e5599a81965c3d7da88995f70455e8fcb8e30 (commit)
       via  c1040a74c10a9a011a04ad0d347b61465c5ee194 (commit)
       via  9478566087f83d1fac2c9a7629898a3d39a05fdd (commit)
       via  cb3e1296ac8a01fcf4b38d10584f218722655e1c (commit)
       via  72d36af268fa7bee24466e21d2d543d8d1ce7b1c (commit)
      from  555ce8b7686c798b0cc599b218955147b0d4c5ea (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 -----------------------------------------------------------------
commit 1f2e5599a81965c3d7da88995f70455e8fcb8e30
Merge: cb3e129 c1040a7
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 23 10:52:08 2011 +0200

    Merge branch 'maint'
    
    * maint:
      help: improve text about automatically-distributed files
      refactor: split 'usage' subroutine in automake

commit cb3e1296ac8a01fcf4b38d10584f218722655e1c
Merge: 555ce8b 72d36af
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 23 10:34:39 2011 +0200

    Merge branch 'maint'
    
    * maint:
      tests: fix bug in 'autodist.test'

-----------------------------------------------------------------------

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 8cb078a..f58bedb 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 7827680..517eea9 100644
--- a/automake.in
+++ b/automake.in
@@ -8366,6 +8366,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 ()
 {
@@ -8399,51 +8443,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 59ddcfd..2236f60 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8321,7 +8321,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 6060a62..ab8ce79 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -176,6 +176,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 3b7a63e..a445725 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -449,6 +449,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 09dcc82..6c0a1d5 100755
--- a/tests/autodist-subdir.test
+++ b/tests/autodist-subdir.test
@@ -37,33 +37,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 681be09..f6fa6fd 100755
--- a/tests/autodist.test
+++ b/tests/autodist.test
@@ -23,15 +23,13 @@
 
 # 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-static && test -f ../defs || Exit 99
 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
@@ -42,33 +40,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]