From unknown Fri Jun 20 05:29:38 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#7345 <7345@debbugs.gnu.org> To: bug#7345 <7345@debbugs.gnu.org> Subject: Status: [PATCH] {maint} Fix a bug in variable concatanation with `+='. (was: Re: bug#7333: bug concatenating CLEANFILES in automake 1.11) Reply-To: bug#7345 <7345@debbugs.gnu.org> Date: Fri, 20 Jun 2025 12:29:38 +0000 retitle 7345 [PATCH] {maint} Fix a bug in variable concatanation with `+=3D= '. (was: Re: bug#7333: bug concatenating CLEANFILES in automake 1.11) reassign 7345 automake submitter 7345 Stefano Lattarini severity 7345 normal tag 7345 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 06 13:06:55 2010 Received: (at submit) by debbugs.gnu.org; 6 Nov 2010 17:06:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PEmEB-0001AX-Da for submit@debbugs.gnu.org; Sat, 06 Nov 2010 13:06:55 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PEmEA-0001AS-0m for submit@debbugs.gnu.org; Sat, 06 Nov 2010 13:06:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PEmIX-0001N4-HS for submit@debbugs.gnu.org; Sat, 06 Nov 2010 13:11:27 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:60458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PEmIX-0001Mz-Bu for submit@debbugs.gnu.org; Sat, 06 Nov 2010 13:11:25 -0400 Received: from [140.186.70.92] (port=46403 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PEmIW-00026h-0X for bug-automake@gnu.org; Sat, 06 Nov 2010 13:11:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PEmIU-0001MG-QS for bug-automake@gnu.org; Sat, 06 Nov 2010 13:11:23 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:58360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PEmIQ-0001LU-W2; Sat, 06 Nov 2010 13:11:19 -0400 Received: by wyf23 with SMTP id 23so4604573wyf.0 for ; Sat, 06 Nov 2010 10:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :message-id; bh=D2dQYWjtfEq/1DS2hFEKwEdJiJ34QIPLg+qNd8ETacg=; b=tIal2iXPdV/q4N0OSr9yg9Xn4AXJPyMWNOGd1ErpYe4yWRsAklJUp+BgXsqgtnoT7s 7+6mHH1bQkbKEpct5EwLFw6TgL2tB2jeoi14ZLPcEblpyX5b/o6NRg/zSimz1FKsnCeF 26oRuwMRVkS3S+P6aDh98Z1S0qh6ART3I/Fnc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:message-id; b=GVukj8UIiFNQMpeC27QhANvYGDFQIeoemw9y+gkIDmkVWoacwjMTtaHRGJ1rzlQ5Xf LxD7kEHTUFXsfHb7WRwxzTnj+65Mf1W7mDt+Kql1nKcK0H9ysOuyy4O4BVDeI7K2+CvX HfOl/z9uoQp+wLM/gwflL6bjHj93bcTqK416k= Received: by 10.227.145.68 with SMTP id c4mr3389755wbv.42.1289063477773; Sat, 06 Nov 2010 10:11:17 -0700 (PDT) Received: from bigio.localnet (host18-58-dynamic.1-79-r.retail.telecomitalia.it [79.1.58.18]) by mx.google.com with ESMTPS id f14sm2319680wbe.8.2010.11.06.10.11.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 06 Nov 2010 10:11:17 -0700 (PDT) From: Stefano Lattarini To: automake-patches@gnu.org Subject: [PATCH] {maint} Fix a bug in variable concatanation with `+='. (was: Re: bug#7333: bug concatenating CLEANFILES in automake 1.11) Date: Sat, 6 Nov 2010 18:10:44 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <201011051214.38475.stefano.lattarini@gmail.com> In-Reply-To: <201011051214.38475.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_VwY1MJP6XMh49LR" Message-Id: <201011061810.46020.stefano.lattarini@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit Cc: Andy Wingo , Ben Denckla , bug-automake@gnu.org, 7333@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.8 (----) --Boundary-00=_VwY1MJP6XMh49LR Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Friday 05 November 2010, Stefano Lattarini wrote: > I can confirm the bug with latest automake (from git master), with > a much-reduced minimal testcase (see attachment). > > I still haven't looked for an explanation or a fix, though. I've manged to find a very simple fix for the bug (see attached patch). OK to apply to maint? Regards, Stefano --Boundary-00=_VwY1MJP6XMh49LR Content-Type: text/x-patch; charset="us-ascii"; name="0001-Fix-a-bug-in-variable-concatanation-with.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="0001-Fix-a-bug-in-variable-concatanation-with.patch" =46rom b8de299295e081909c6d0a8a1cef957b337e3732 Mon Sep 17 00:00:00 2001 =46rom: Stefano Lattarini Date: Sat, 6 Nov 2010 12:46:52 +0100 Subject: [PATCH] Fix a bug in variable concatanation with `+=3D'. * lib/Automake/VarDef.pm (append): Remove extra backslash-escaped newlines from the end of the variable's content, before appending to it. * tests/pluseq11.test: New test, exposing the bug. * tests/Makefile.am (TESTS): Update. Reported by Andy Wingo. =2D-- ChangeLog | 10 ++++++++ lib/Automake/VarDef.pm | 13 +--------- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/pluseq11.test | 54 ++++++++++++++++++++++++++++++++++++++++++++= ++++ 5 files changed, 68 insertions(+), 11 deletions(-) create mode 100755 tests/pluseq11.test diff --git a/ChangeLog b/ChangeLog index 6c17cd3..a928363 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2010-11-06 Stefano Lattarini + + Fix a bug in variable concatanation with `+=3D'. + * lib/Automake/VarDef.pm (append): Remove extra backslash-escaped + newlines from the end of the variable's content, before appending + to it. + * tests/pluseq11.test: New test, exposing the bug. + * tests/Makefile.am (TESTS): Update. + Reported by Andy Wingo. + 2010-11-01 Ralf Wildenhues =20 Fix and document rules to not touch the tree with `make -n'. diff --git a/lib/Automake/VarDef.pm b/lib/Automake/VarDef.pm index d7ba155..568c82a 100644 =2D-- 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 =3D~ s/ ?#.*//; =2D =2D if (chomp $val) =2D { =2D # Insert a backslash before a trailing newline. =2D $val .=3D "\\\n"; =2D } =2D elsif ($val) =2D { =2D # Insert a separator. =2D $val .=3D ' '; =2D } + # Insert a separator, if required. + $val .=3D ' ' if $val; $self->{'value'} =3D $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 =2D-- 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 =2D-- 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/pluseq11.test b/tests/pluseq11.test new file mode 100755 index 0000000..293270f =2D-- /dev/null +++ b/tests/pluseq11.test @@ -0,0 +1,54 @@ +#!/bin/sh +# Copyright (C) 2010 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 . + +# Check for bug in variable concatenation with `+=3D': an extra backslash +# is erroneously retained in the final value. +# See also sister test pluseq11b.test. + +. ./defs || Exit 1 + +set -e + +cat >>configure.in <<'END' +AC_OUTPUT +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 =3D \ +\ +\ +bar +## Both this two variable additions are required to trigger the bug. +FOO +=3D +FOO +=3D baz + +.PHONY: test +test: + case '$(FOO)' in *\\*) exit 1;; *) exit 0;; esac +END + +$ACLOCAL +$AUTOMAKE + +grep '^ *FOO *=3D.*\\.' Makefile.in && Exit 1 + +$AUTOCONF +./configure +$MAKE test + +: =2D-=20 1.7.1 --Boundary-00=_VwY1MJP6XMh49LR-- From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 08 16:41:42 2010 Received: (at control) by debbugs.gnu.org; 8 Nov 2010 21:41:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PFZTB-0000Kg-RH for submit@debbugs.gnu.org; Mon, 08 Nov 2010 16:41:42 -0500 Received: from mailout-de.gmx.net ([213.165.64.23] helo=mail.gmx.net) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PFZT4-0000KT-0Z for control@debbugs.gnu.org; Mon, 08 Nov 2010 16:41:36 -0500 Received: (qmail invoked by alias); 08 Nov 2010 21:46:11 -0000 Received: from xdsl-89-0-159-90.netcologne.de (EHLO localhost.localdomain) [89.0.159.90] by mail.gmx.net (mp061) with SMTP; 08 Nov 2010 22:46:11 +0100 X-Authenticated: #13673931 X-Provags-ID: V01U2FsdGVkX1+dvNtTHsqd8HRrQW29ml8Xx/l6Owjcr2mWHUPL/3 bmoOzYVuuYB6eL Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1PFZXV-0004pU-NH; Mon, 08 Nov 2010 22:46:09 +0100 Date: Mon, 8 Nov 2010 22:46:09 +0100 From: Ralf Wildenhues To: Stefano Lattarini Subject: Re: bug#7333: [PATCH] {maint} Fix a bug in variable concatanation with `+='. Message-ID: <20101108214609.GF18320@gmx.de> References: <201011061810.46020.stefano.lattarini@gmail.com> <20101107132607.GD11896@ins.uni-bonn.de> <201011071526.54124.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011071526.54124.stefano.lattarini@gmail.com> Organization: Institute for Numerical Simulation, University of Bonn User-Agent: Mutt/1.5.20 (2010-08-04) X-Y-GMX-Trusted: 0 X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: control Cc: Andy Wingo , Ben Denckla , 7333@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) merge 7333 7345 tags 7333 + patch close 7333 v1.11-222-g7a020d6 thanks * Stefano Lattarini wrote on Sun, Nov 07, 2010 at 03:26:52PM CET: > Now, should I also try to close the bug #7333 on debbugs? > The instruction at seems > quite clear about how to do so, so I think I can manage to get it > right. > > BTW, Ouch! I see that my previous reply presenting the patch > has erroneously opended a new, spurious bug report (#7345) in > the tracker! Ralf, could you please you close that report as > invalid? Not sure how that happened, probably the Subject: change. The commands above (Bcc:ed to control at debbugs) should merge and close both bugs. Cheers, Ralf From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 09 01:46:51 2010 Received: (at control) by debbugs.gnu.org; 9 Nov 2010 06:46:51 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PFhyk-0005t8-S4 for submit@debbugs.gnu.org; Tue, 09 Nov 2010 01:46:51 -0500 Received: from mailout-de.gmx.net ([213.165.64.22] helo=mail.gmx.net) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PFhyi-0005t3-K7 for control@debbugs.gnu.org; Tue, 09 Nov 2010 01:46:49 -0500 Received: (qmail invoked by alias); 09 Nov 2010 06:51:27 -0000 Received: from xdsl-89-0-145-142.netcologne.de (EHLO localhost.localdomain) [89.0.145.142] by mail.gmx.net (mp056) with SMTP; 09 Nov 2010 07:51:27 +0100 X-Authenticated: #13673931 X-Provags-ID: V01U2FsdGVkX19tdbwCWvVttZOEYSAxC6aC9x41J4W+hTuQ8Tiwf/ lwwgFx1ea16TKT Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1PFi3C-0005FQ-As for control@debbugs.gnu.org; Tue, 09 Nov 2010 07:51:26 +0100 Date: Tue, 9 Nov 2010 07:51:26 +0100 From: Ralf Wildenhues To: control@debbugs.gnu.org Subject: bug#7333 Message-ID: <20101109065126.GC19221@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2010-08-04) X-Y-GMX-Trusted: 0 X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) close 7333 thanks From unknown Fri Jun 20 05:29:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 09 Dec 2010 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator