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-758-g


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-758-g6743961
Date: Sat, 17 Mar 2012 08:47:13 +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=6743961843f3d810500aabe20cfe2cb0e9ae5839

The branch, maint has been updated
       via  6743961843f3d810500aabe20cfe2cb0e9ae5839 (commit)
       via  a75a1a52679feed85a181dcf514e32e17117157b (commit)
      from  819005ae2c86c3ef4b77bea7176bb6d8b67ebd64 (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 6743961843f3d810500aabe20cfe2cb0e9ae5839
Author: Stefano Lattarini <address@hidden>
Date:   Sat Mar 17 09:43:35 2012 +0100

    aclocal: remove a couple of useless imports
    
    * aclocal.in (File::stat, Cwd): Remove these imports, they are not
    really required.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit a75a1a52679feed85a181dcf514e32e17117157b
Author: Stefano Lattarini <address@hidden>
Date:   Thu Mar 15 16:50:40 2012 +0100

    aclocal: create local directory where to install m4 files
    
    Fixes automake bug#8168 and bug#10816.
    
    A call like "aclocal -I m4 --install" used to fail if the 'm4'
    directory wasn't pre-existing.  This could be particularly
    annoying when running in a checked-out version from a VCS like
    git, which doesn't allow empty directories to be tracked.
    
    * aclocal.in (File::Path): New import.
    (scan_m4_dirs): Don't die if the first directory of type FT_USER
    doesn't exist and the '--install' option was given; that directory
    will be created later ...
    (install_file): ... here.  Change signature of this function: now
    it takes as second argument the destination directory rather than
    the destination file.  Crate the destination directory if it
    doesn't already exist.  In verbose mode, tell what is being copied
    where.
    (write_aclocal): Update to the changes in 'install_file'.
    * NEWS, THANKS: Update.
    * tests/aclocal-install-fail.test: New test.
    * tests/aclocal-install-mkdir.test: Likewise.
    * tests/aclocal-no-install-no-mkdir.test: Likewise.
    * tests/aclocal-verbose-install.test: Likewise.
    * tests/list-of-tests.mk: Add them.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

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

Summary of changes:
 NEWS                                               |    4 +
 THANKS                                             |    2 +
 aclocal.in                                         |   42 +++++++++---
 tests/aclocal-install-fail.test                    |   65 ++++++++++++++++++
 tests/aclocal-install-mkdir.test                   |   72 ++++++++++++++++++++
 ...regex.test => aclocal-no-install-no-mkdir.test} |   23 +++---
 ...auxfile-2.test => aclocal-verbose-install.test} |   56 +++++++---------
 tests/list-of-tests.mk                             |    4 +
 8 files changed, 214 insertions(+), 54 deletions(-)
 create mode 100755 tests/aclocal-install-fail.test
 create mode 100755 tests/aclocal-install-mkdir.test
 copy tests/{help-regex.test => aclocal-no-install-no-mkdir.test} (66%)
 copy tests/{dist-auxfile-2.test => aclocal-verbose-install.test} (51%)

diff --git a/NEWS b/NEWS
index b998ce4..2b5f68f 100644
--- a/NEWS
+++ b/NEWS
@@ -122,6 +122,10 @@ New in 1.11.0a:
     optional space between the -I, -L and -l options and their respective
     arguments, for better POSIX compliance.
 
+  - If "aclocal --install" is used, and the first directory specified with
+    '-I' is non-existent, aclocal will now create it before trying to copy
+    files in it.
+
 Bugs fixed in 1.11.0a:
 
 * Bugs introduced by 1.11.2:
diff --git a/THANKS b/THANKS
index 8363126..d7b3658 100644
--- a/THANKS
+++ b/THANKS
@@ -73,6 +73,7 @@ Dave Brolley          address@hidden
 Dave Korn              address@hidden
 Dave Morrison          address@hidden
 David A. Swierczek     address@hidden
+David A. Wheeler       address@hidden
 David Byron            address@hidden
 Davyd Madeley          address@hidden
 David Pashley          address@hidden
@@ -149,6 +150,7 @@ Janos Farkas                address@hidden
 Jared Davis            address@hidden
 Jason Duell            address@hidden
 Jason Molenda          address@hidden
+Javier Jardón         address@hidden
 Jeff Bailey            address@hidden
 Jeff Garzik            address@hidden
 Jeff Squyres           address@hidden
diff --git a/aclocal.in b/aclocal.in
index ed1d8d9..4764379 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -7,9 +7,7 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S 
"$0" "$@";; esac'
 
 # aclocal - create aclocal.m4 by scanning configure.ac
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 1996-2012 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
@@ -43,8 +41,7 @@ use Automake::ChannelDefs;
 use Automake::XFile;
 use Automake::FileUtils;
 use File::Basename;
-use File::stat;
-use Cwd;
+use File::Path ();
 
 # Some globals.
 
@@ -181,6 +178,17 @@ sub unlink_tmp
 $SIG{'INT'} = $SIG{'TERM'} = $SIG{'QUIT'} = $SIG{'HUP'} = 'unlink_tmp';
 END { unlink_tmp }
 
+sub xmkdir_p ($)
+{
+  my $dir = shift;
+  local $@ = undef;
+  return
+    if -d $dir or eval { File::Path::mkpath $dir };
+  chomp $@;
+  $@ =~ s/\s+at\s.*\bline\s\d+.*$//;
+  fatal "could not create directory '$dir': $@";
+}
+
 # Check macros in acinclude.m4.  If one is not used, warn.
 sub check_acinclude ()
 {
@@ -210,12 +218,15 @@ sub reset_maps ()
   undef &search;
 }
 
-# install_file ($SRC, $DEST)
+# install_file ($SRC, $DESTDIR)
 sub install_file ($$)
 {
-  my ($src, $dest) = @_;
+  my ($src, $destdir) = @_;
+  my $dest = $destdir . "/" . basename ($src);
   my $diff_dest;
 
+  verb "installing $src to $dest";
+
   if ($force_output
       || !exists $file_contents{$dest}
       || $file_contents{$src} ne $file_contents{$dest})
@@ -268,6 +279,7 @@ sub install_file ($$)
        }
       elsif (!$dry_run)
        {
+          xmkdir_p ($destdir);
          xsystem ('cp', $src, $dest);
        }
     }
@@ -307,6 +319,7 @@ sub list_compare (address@hidden@)
 # --------------------------
 # Scan all M4 files installed in @DIRS for new macro definitions.
 # Register each file as of type $TYPE (one of the FT_* constants).
+my $first_user_m4dir = 1;
 sub scan_m4_dirs ($@)
 {
   my ($type, @dirlist) = @_;
@@ -315,7 +328,16 @@ sub scan_m4_dirs ($@)
     {
       if (! opendir (DIR, $m4dir))
        {
-         fatal "couldn't open directory `$m4dir': $!";
+         if ($install && $type == FT_USER && $first_user_m4dir)
+            {
+              # We will try to create this directory later, so don't
+              # complain if it doesn't exist.
+              # TODO: maybe we should avoid complaining only if errno
+              # is ENONENT?
+              $first_user_m4dir = 0;
+              next;
+            }
+         fatal "couldn't open directory '$m4dir': $!";
        }
 
       # We reverse the directory contents so that foo2.m4 gets
@@ -773,9 +795,7 @@ sub write_aclocal ($@)
              my $dest;
              for my $ifile (@{$file_includes{$file}}, $file)
                {
-                 $dest = "$user_includes[0]/" . basename $ifile;
-                 verb "installing $ifile to $dest";
-                 install_file ($ifile, $dest);
+                 install_file ($ifile, $user_includes[0]);
                }
              $installed = 1;
            }
diff --git a/tests/aclocal-install-fail.test b/tests/aclocal-install-fail.test
new file mode 100755
index 0000000..cf493aa
--- /dev/null
+++ b/tests/aclocal-install-fail.test
@@ -0,0 +1,65 @@
+#! /bin/sh
+# Copyright (C) 2012 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 "aclocal --install" fails when it should.
+# FIXME: this is a good candidate for a conversion to TAP.
+
+am_create_testdir=empty
+required=ro-dir
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+MY_MACRO
+END
+
+mkdir sys-acdir
+cat > sys-acdir/my-defs.m4 <<END
+AC_DEFUN([MY_MACRO], [:])
+END
+
+ACLOCAL="$ACLOCAL -Wnone --system-acdir=sys-acdir"
+
+: > a-regular-file
+mkdir unwritable-dir
+chmod a-w unwritable-dir
+
+$ACLOCAL -I a-regular-file --install 2>stderr \
+  && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+$EGREP '(mkdir:|directory ).*a-regular-file' stderr
+test ! -f aclocal.m4
+
+$ACLOCAL --install -I unwritable-dir/sub 2>stderr \
+  && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+$EGREP '(mkdir:|directory ).*unwritable-dir/sub' stderr
+test ! -f aclocal.m4
+
+$ACLOCAL -I unwritable-dir --install 2>stderr \
+  && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+$EGREP '(cp:|copy ).*unwritable-dir' stderr
+test ! -f aclocal.m4
+
+# Sanity check.
+mkdir m4
+$ACLOCAL -I m4 --install && test -f aclocal.m4 \
+  || fatal_ "aclocal failed also when expected to succeed"
+
+:
diff --git a/tests/aclocal-install-mkdir.test b/tests/aclocal-install-mkdir.test
new file mode 100755
index 0000000..54e97ab
--- /dev/null
+++ b/tests/aclocal-install-mkdir.test
@@ -0,0 +1,72 @@
+#! /bin/sh
+# Copyright (C) 2012 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 "aclocal --install" creates the local m4 directory if
+# necessary.
+# FIXME: this is a good candidate for a conversion to TAP.
+
+am_create_testdir=empty
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+MY_MACRO
+END
+
+mkdir sys-acdir
+cat > sys-acdir/my-defs.m4 <<END
+AC_DEFUN([MY_MACRO], [:])
+END
+
+ACLOCAL="$ACLOCAL --system-acdir=sys-acdir"
+
+$ACLOCAL -I foo --install
+test -f foo/my-defs.m4
+
+$ACLOCAL --install -I "`pwd`/bar"
+test -f bar/my-defs.m4
+
+$ACLOCAL --install -I baz/sub/sub2
+test -f baz/sub/sub2/my-defs.m4
+
+# What should happen:
+#  * zardoz1 should be created, and required m4 files copied into there.
+#  * zardoz2 shouldn't be preferred to quux, even if the former exists
+#    while the latter does not.
+mkdir zardoz2
+$ACLOCAL --install -I zardoz1 -I zardoz2
+test -d zardoz1
+grep MY_MACRO zardoz1/my-defs.m4
+ls zardoz2 | grep . && Exit 1
+
+# Directories in ACLOCAL_PATH should never be created if they don't
+# exist.
+ACLOCAL_PATH="`pwd`/none:`pwd`/none2" $ACLOCAL --install && Exit 1
+test ! -d none
+test ! -d none2
+ACLOCAL_PATH="`pwd`/none:`pwd`/none2" $ACLOCAL --install -I x
+test -f x/my-defs.m4
+test ! -d none
+test ! -d none2
+
+# It's better if aclocal doesn't create the first include dir on failure.
+$ACLOCAL --install -I none -I none2 && Exit 1
+test ! -d none
+test ! -d none2
+
+:
diff --git a/tests/help-regex.test b/tests/aclocal-no-install-no-mkdir.test
similarity index 66%
copy from tests/help-regex.test
copy to tests/aclocal-no-install-no-mkdir.test
index 3eff5f9..73a6116 100755
--- a/tests/help-regex.test
+++ b/tests/aclocal-no-install-no-mkdir.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2010 Free Software Foundation, Inc.
+# Copyright (C) 2012 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
@@ -14,25 +14,26 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure that obsolescent macro `AM_WITH_REGEX' adds proper text to
-# the configure help screen.
+# Check that aclocal does not create a non-existent local m4 directory
+# if the '--install' option is not given.
 
+am_create_testdir=empty
 . ./defs || Exit 1
 
 set -e
 
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
-AM_WITH_REGEX
+MY_MACRO
 END
 
-$ACLOCAL
-$AUTOCONF
-
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
+mkdir sys-acdir
+cat > sys-acdir/my-defs.m4 <<END
+AC_DEFUN([MY_MACRO], [:])
+END
 
-$FGREP ' --without-regex ' stdout
-$FGREP ' use GNU rx ' stdout
+$ACLOCAL -I foo --system-acdir=sys-acdir && Exit 1
+test ! -d foo
+test ! -r foo
 
 :
diff --git a/tests/dist-auxfile-2.test b/tests/aclocal-verbose-install.test
similarity index 51%
copy from tests/dist-auxfile-2.test
copy to tests/aclocal-verbose-install.test
index 08daa6c..589d540 100755
--- a/tests/dist-auxfile-2.test
+++ b/tests/aclocal-verbose-install.test
@@ -14,10 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Files specified by AC_REQUIRE_AUX_FILE must exist, and if a Makefile
-# is present in the build-aux directory, they correctly get automatically
-# distributed.
-# Related to automake bug#9651.
+# Check verbose messages by `aclocal --install'.
 
 am_create_testdir=empty
 . ./defs || Exit 1
@@ -26,37 +23,32 @@ set -e
 
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
-AC_CONFIG_AUX_DIR([sub])
-AM_INIT_AUTOMAKE
-AC_REQUIRE_AUX_FILE([zardoz])
-AC_CONFIG_FILES([Makefile sub/Makefile])
-AC_OUTPUT
+MY_MACRO_BAR
+MY_MACRO_QUUX
 END
 
-cat > Makefile.am <<'END'
-SUBDIRS = sub
-test: distdir
-       ls -l $(distdir) $(distdir)/* ;: For debugging.
-       test -f $(distdir)/sub/zardoz
-.PHONY: test
-check-local: test
+mkdir sys-acdir
+cat > sys-acdir/bar.m4 <<END
+AC_DEFUN([MY_MACRO_BAR], [:])
+END
+cat > sys-acdir/quux.m4 <<END
+AC_DEFUN([MY_MACRO_QUUX], [:])
 END
 
-mkdir sub
-: > sub/Makefile.am
-
-echo dummy > sub/zardoz
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-test -f sub/install-sh
-# Should work also without `--add-missing'.
-$AUTOMAKE
-
-./configure
-
-$MAKE test
-$MAKE distcheck
+mkdir foodir
+: > foodir/bar.m4
+
+$ACLOCAL --system-acdir=sys-acdir --install --verbose -I foodir 2>stderr \
+ || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep ' installing .*sys-acdir/bar\.m4.* to .*foodir/bar\.m4' stderr
+grep ' installing .*sys-acdir/quux\.m4.* to .*foodir/quux\.m4' stderr
+grep ' overwriting .*foodir/bar\.m4.* with .*sys-acdir/bar\.m4' stderr
+grep ' installing .*foodir/quux\.m4.* from .*sys-acdir/quux\.m4' stderr
+
+# Sanity checks.
+ls -l foodir
+grep MY_MACRO_BAR foodir/bar.m4
+grep MY_MACRO_QUUX foodir/quux.m4
 
 :
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index b5a604c..f9109c0 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -64,6 +64,10 @@ aclocal-path-install.test \
 aclocal-path-install-serial.test \
 aclocal-path-nonexistent.test \
 aclocal-path-precedence.test \
+aclocal-install-fail.test \
+aclocal-install-mkdir.test \
+aclocal-no-install-no-mkdir.test \
+aclocal-verbose-install.test \
 acoutnoq.test \
 acoutpt.test \
 acoutpt2.test \


hooks/post-receive
-- 
GNU Automake



reply via email to

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