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


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-224-g551b113
Date: Sun, 07 Nov 2010 15:37:14 +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=551b1133da2b17fb3d2171346fd4af86f05ad5fe

The branch, maint has been updated
       via  551b1133da2b17fb3d2171346fd4af86f05ad5fe (commit)
       via  7a020d668ab1bf8f36bb1719b63f784c64ae74f2 (commit)
      from  6afea5000636292d3aa7e8933aa61a0d851fa5ad (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                                |   13 +++++++++
 lib/Automake/VarDef.pm                   |   13 +--------
 tests/Makefile.am                        |    1 +
 tests/Makefile.in                        |    1 +
 tests/{autohdrdry.test => pluseq11.test} |   41 ++++++++++++++++++-----------
 5 files changed, 42 insertions(+), 27 deletions(-)
 copy tests/{autohdrdry.test => pluseq11.test} (57%)

diff --git a/ChangeLog b/ChangeLog
index e3559dc..a356958 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-07  Stefano Lattarini  <address@hidden>
+
+       Fix a bug in variable concatanation with `+='.
+       * lib/Automake/VarDef.pm (append): Since the content of the
+       "appended-to" variable is going to be unconditionally normalized
+       later, simply separate the appended value with a single whitespace
+       character, instead of trying to be uselesssly smarter by using
+       escaped newlines.  This fixes a bug in which extra backslashes
+       where erroneously inserted in the variable's final value.
+       * tests/pluseq11.test: New test, exposing the bug.
+       * tests/Makefile.am (TESTS): Update.
+       Reported by Andy Wingo.
+
 2010-11-06  Stefano Lattarini  <address@hidden>
 
        Fix bug in rules for creating vala vapi/header files.
diff --git a/lib/Automake/VarDef.pm b/lib/Automake/VarDef.pm
index d7ba155..568c82a 100644
--- a/lib/Automake/VarDef.pm
+++ b/lib/Automake/VarDef.pm
@@ -185,17 +185,8 @@ sub append ($$$)
   # Furthermore keeping `#' would not be portable if the variable is
   # output on multiple lines.
   $val =~ s/ ?#.*//;
-
-  if (chomp $val)
-    {
-      # Insert a backslash before a trailing newline.
-      $val .= "\\\n";
-    }
-  elsif ($val)
-    {
-      # Insert a separator.
-      $val .= ' ';
-    }
+  # Insert a separator, if required.
+  $val .= ' ' if $val;
   $self->{'value'} = $val . $value;
   # Turn ASIS appended variables into PRETTY variables.  This is to
   # cope with `make' implementation that cannot read very long lines.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9c81564..da81c49 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -570,6 +570,7 @@ pluseq7.test \
 pluseq8.test \
 pluseq9.test \
 pluseq10.test \
+pluseq11.test \
 postproc.test \
 ppf77.test \
 pr2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index b568a09..eb461a9 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -837,6 +837,7 @@ pluseq7.test \
 pluseq8.test \
 pluseq9.test \
 pluseq10.test \
+pluseq11.test \
 postproc.test \
 ppf77.test \
 pr2.test \
diff --git a/tests/autohdrdry.test b/tests/pluseq11.test
similarity index 57%
copy from tests/autohdrdry.test
copy to tests/pluseq11.test
index b501e76..12ec4d7 100755
--- a/tests/autohdrdry.test
+++ b/tests/pluseq11.test
@@ -14,32 +14,41 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Removal recovery rules for AC_CONFIG_HEADERS should not remove files
-# with `make -n'.
+# Check for bug in variable concatenation with `+=': an extra backslash
+# is erroneously retained in the final value.
+# See also sister test pluseq11b.test.
 
 . ./defs || Exit 1
 
 set -e
 
-cat >>configure.in <<'EOF'
-AC_PROG_CC
-AC_CONFIG_HEADERS([config.h])
+cat >>configure.in <<'END'
 AC_OUTPUT
-EOF
-
-: >Makefile.am
+END
+
+cat > Makefile.am <<'END'
+## Use more line continuation to ensure we are robust and can (hopefully)
+## cope any number of them, and not just one
+FOO = \
+\
+\
+bar
+## Both these two variable additions are required to trigger the bug.
+FOO +=
+FOO += baz
+
+.PHONY: test
+test:
+       case '$(FOO)' in *\\*) exit 1;; *) exit 0;; esac
+END
 
 $ACLOCAL
-$AUTOCONF
-$AUTOHEADER
 $AUTOMAKE
 
-./configure
-$MAKE
+grep '^ *FOO *=.*\\.' Makefile.in && Exit 1
 
-rm -f config.h
-$MAKE -n
-test -f stamp-h1
-test ! -f config.h
+$AUTOCONF
+./configure
+$MAKE test
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

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