From unknown Mon Aug 18 11:15:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8168: macros directory not created automatically Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Thu, 03 Mar 2011 20:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8168 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: automake@gnu.org Cc: 8168@debbugs.gnu.org X-Debbugs-Original-Cc: bug-automake@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.129918464711252 (code B ref -1); Thu, 03 Mar 2011 20:38:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Mar 2011 20:37:27 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PvFH4-0002vP-Bx for submit@debbugs.gnu.org; Thu, 03 Mar 2011 15:37:26 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PvFH2-0002vB-F1 for submit@debbugs.gnu.org; Thu, 03 Mar 2011 15:37:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvFGw-0004ez-Cx for submit@debbugs.gnu.org; Thu, 03 Mar 2011 15:37:19 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:49313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvFGw-0004ev-Ax for submit@debbugs.gnu.org; Thu, 03 Mar 2011 15:37:18 -0500 Received: from [140.186.70.92] (port=57658 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvFGv-0000by-BM for bug-automake@gnu.org; Thu, 03 Mar 2011 15:37:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvFGu-0004eQ-EQ for bug-automake@gnu.org; Thu, 03 Mar 2011 15:37:17 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:46790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvFGs-0004e3-8m; Thu, 03 Mar 2011 15:37:14 -0500 Received: by wyi11 with SMTP id 11so1688618wyi.0 for ; Thu, 03 Mar 2011 12:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:references :in-reply-to:cc:mime-version:content-type:content-transfer-encoding :message-id; bh=V0fMSwOuxGqW1/qfySSOmxfIcJivGNmx7fFh4SLcR7s=; b=HBmdKB+e50Dq+QvElt65y1JnanasyEw6fYBwXERKk35Wka4uV7JBDZ5p7LYMx0xOTl UxVtv3zMxOSB4uanz1LdzZJjOEH+Nr/M6yDjFcXBF4vnTu7lJeeIxkkJ3di0zIZlRRHf OkbnGE8/O8B9KNGePTYP1sQI7iVKEFQ1Nz4iA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:cc :mime-version:content-type:content-transfer-encoding:message-id; b=f3o8nXTsQwj/N2ClvIteK2/dap/+Epo3EluFtzMEmQjAXhe2qhqlRgvgedWClTYxy9 cUBHsM3gNqBN4lSNZpLp6bhi5Id9dyrs+xrfLDrI3uDDM2y42Sm2HKa7Tw19jDeA74A4 gYlEkqyOE42FyJzkDQsmv+tdHfmQ2KXPeEi0M= Received: by 10.216.158.21 with SMTP id p21mr976854wek.99.1299184633065; Thu, 03 Mar 2011 12:37:13 -0800 (PST) Received: from bigio.localnet (host30-97-dynamic.0-87-r.retail.telecomitalia.it [87.0.97.30]) by mx.google.com with ESMTPS id m6sm789416wej.10.2011.03.03.12.37.10 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Mar 2011 12:37:11 -0800 (PST) From: Stefano Lattarini Date: Thu, 3 Mar 2011 21:36:51 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201103032136.52231.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-Received-From: 199.232.76.165 X-Spam-Score: -5.9 (-----) 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: -5.9 (-----) [adding bug-automake] On Thursday 03 March 2011, Javier Jard=F3n wrote: > Hi, > Hi Javier, and thanks for the report. > I'm using >=20 > ACLOCAL_AMFLAGS =3D -I m4 ${ACLOCAL_FLAGS} >=20 > in my main Makefile.am, but I have to add the m4 directory to the git > tree, or create it in my autogen script (and this doesnt work if I do > not use a autogen file and only autoreconf instead) >=20 > Shouldnt be automake smart enough to create that directory automatically? > Probably yes -- but IMHO it should then also be smart enough to create the directory *only* when it makes sense, i.e. only when the `--install' flag is used too. Also, it might be useful if aclocal would not complain (or at least would not error out) in case it is passed a non-existent or unreadable directory through the `-I' option. This "laxer" behaviour is implemented in many other gnu tools already (e.g., make, m4. gcc). I might take a look at this issues in the next(ish) days. Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 14 14:45:21 2011 Received: (at control) by debbugs.gnu.org; 14 Mar 2011 18:45:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PzClc-0005o9-E0 for submit@debbugs.gnu.org; Mon, 14 Mar 2011 14:45:20 -0400 Received: from mail-ey0-f172.google.com ([209.85.215.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PzClZ-0005nt-2k for control@debbugs.gnu.org; Mon, 14 Mar 2011 14:45:17 -0400 Received: by eye13 with SMTP id 13so1752795eye.3 for ; Mon, 14 Mar 2011 11:45:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:mime-version :content-type:content-transfer-encoding:message-id; bh=1hgIwDyPx0ecMJgsCcg3mCNkyQVMbtApd19yuXl6ghA=; b=HJ/yW1xtAvPmraaUkF6aKqX5x26FAu8iTRk/otDmVRNhtSXq+ZjX9aJq3rkSDdHhij Km7ZVmLeeXfaFgNvan5KnVB6Y4dkN+tBTdUKzccwZKX5/z0rlBDK3VHUyLuH9CEXvVOo trCHys+YbQ2ux41cCvmXisGqdYeAfMrK2jwNo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; b=IF5WyOHNYOTqtyr5UeOp1lwqRvyUIuW9NngoZ1wuw/+Q/04+ULDRUctnKWRmyG2s23 Rpn+jVP00CGZ1zFv+Lzt4XMMfeAHqnJVzx2ALtuFy7TG36vc8PYQxGH+CHI/KDU61lxD HHbePWXOUdO8rJH6EzOE4hfcFCG4qfhWXBrYk= Received: by 10.213.0.213 with SMTP id 21mr1586365ebc.117.1300128311182; Mon, 14 Mar 2011 11:45:11 -0700 (PDT) Received: from bigio.localnet (host116-92-dynamic.2-87-r.retail.telecomitalia.it [87.2.92.116]) by mx.google.com with ESMTPS id u45sm3905690eeh.14.2011.03.14.11.45.09 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Mar 2011 11:45:10 -0700 (PDT) From: Stefano Lattarini To: control@debbugs.gnu.org Subject: automake bug#8168 Date: Mon, 14 Mar 2011 19:44:57 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Message-Id: <201103141944.58377.stefano.lattarini@gmail.com> X-Spam-Score: -4.2 (----) 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: -4.1 (----) submitter 8168 Javier Jard=F3n thanks=20 From unknown Mon Aug 18 11:15:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8168: macros directory not created automatically Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Mon, 14 Mar 2011 19:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8168 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: 8168@debbugs.gnu.org Cc: Javier =?UTF-8?Q?Jard=C3=B3n?= , automake-patches@gnu.org Received: via spool by 8168-submit@debbugs.gnu.org id=B8168.130013187630208 (code B ref 8168); Mon, 14 Mar 2011 19:45:02 +0000 Received: (at 8168) by debbugs.gnu.org; 14 Mar 2011 19:44:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PzDgw-0007rA-13 for submit@debbugs.gnu.org; Mon, 14 Mar 2011 15:44:35 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PzDgs-0007qw-NY for 8168@debbugs.gnu.org; Mon, 14 Mar 2011 15:44:32 -0400 Received: by wwb28 with SMTP id 28so6053767wwb.15 for <8168@debbugs.gnu.org>; Mon, 14 Mar 2011 12:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:message-id; bh=UpnOBzfS5p7EXNPyxnpgMTxDSruoshTH/JLZH3e9rC8=; b=QGgZNkY07yensTdbwVn+u3A2gjopWMXAKsPwqJ2K4R7yDTI707Qt5rzO8LCR5VK8bw 5l+sR+VdgfPDQJ0UjI94vzPxGJbEZqZbBj5GJvrgIdWrFY7+DowMAo3RJXH8J32f4rHG qb8R9/9CMOpnhS4Es9N9K/8bHCRrpt8kNVxg0= 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=op9CbAyv6EHgl6oJGLewz0vEr57QWXMyU2yb0tdAKDEJvQOLNLPHEoqbZ5gfwjXble e+D8xnkcSge7QDFuEEghRnofXb/e8VaTCiTWeYb+gKBD1XrdRylxS4M89wvpLhkidqb+ aUJjfPv3bE+kBVUPxmRo3cEue4ZCD7Ty0k1Y0= Received: by 10.216.174.65 with SMTP id w43mr2677652wel.95.1300131863341; Mon, 14 Mar 2011 12:44:23 -0700 (PDT) Received: from bigio.localnet (host116-92-dynamic.2-87-r.retail.telecomitalia.it [87.2.92.116]) by mx.google.com with ESMTPS id l5sm4022644wej.8.2011.03.14.12.44.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Mar 2011 12:44:21 -0700 (PDT) From: Stefano Lattarini Date: Mon, 14 Mar 2011 20:44:03 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <201103032136.52231.stefano.lattarini@gmail.com> In-Reply-To: <201103032136.52231.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_EAnfNpjAuhFGI7d" Message-Id: <201103142044.04195.stefano.lattarini@gmail.com> X-Spam-Score: -4.0 (----) 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: -3.9 (---) --Boundary-00=_EAnfNpjAuhFGI7d Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable [dropping automake list, adding automake-patches] References: =2D*-*- Hello Javier and all automakes, and sorry for the delay. On Thursday 03 March 2011, Stefano Lattarini wrote: >=20 > On Thursday 03 March 2011, Javier Jard=C3=B3n wrote: > > Hi, > > > Hi Javier, and thanks for the report. >=20 > > I'm using > >=20 > > ACLOCAL_AMFLAGS =3D -I m4 ${ACLOCAL_FLAGS} > >=20 > > in my main Makefile.am, but I have to add the m4 directory to the git > > tree, or create it in my autogen script (and this doesnt work if I do > > not use a autogen file and only autoreconf instead) > >=20 > > Shouldnt be automake smart enough to create that directory automaticall= y? > > > Probably yes -- but IMHO it should then also be smart enough to create > the directory *only* when it makes sense, i.e. only when the `--install' > flag is used too. >=20 > Also, it might be useful if aclocal would not complain (or at least would > not error out) in case it is passed a non-existent or unreadable directory > through the `-I' option. This "laxer" behaviour is implemented in many > other gnu tools already (e.g., make, m4. gcc). >=20 > I might take a look at this issues in the next(ish) days. >=20 > Thanks, > Stefano >=20 Attached is a patch series (2 patches) that should address the issue. The series is based off of maint -- as I'm not yet sure whether it would be better to merge it to master only, or to maint too. Javier, are you ok with your name being added to THANKS? Ralf, OK to apply? If yes, where (maint, or master only)? Regards, Stefano =2D*-*- PATCH 1/2] aclocal: `-I' does not bail out on invalid directories. Related to automake bug#8168. * aclocal.in (scan_m4_dirs): If a user-specified "include directory" is unreadable or non-existent, do not issue a fatal error anymore, but simply issue a warning, and only when running in verbose mode. * NEWS: Update. * tests/aclocal-bad-dirlist-include-dir.test: New test. * tests/aclocal-bad-local-include-dir.test: Likewise. * tests/aclocal-bad-system-include-dir.test: Likewise. * tests/Makefile.am (TESTS): Update. * tests/.gitignore: Update. =2D-- ChangeLog | 15 +++++ NEWS | 5 ++ aclocal.in | 10 +++- tests/.gitignore | 4 +- tests/Makefile.am | 3 + tests/Makefile.in | 3 + tests/aclocal-bad-dirlist-include-dir.test | 36 +++++++++++ tests/aclocal-bad-local-include-dir.test | 90 ++++++++++++++++++++++++= ++++ tests/aclocal-bad-system-include-dir.test | 36 +++++++++++ 9 files changed, 199 insertions(+), 3 deletions(-) create mode 100755 tests/aclocal-bad-dirlist-include-dir.test create mode 100755 tests/aclocal-bad-local-include-dir.test create mode 100755 tests/aclocal-bad-system-include-dir.test =2D*-*- [PATCH 2/2] aclocal: create local directory where to install m4 files Before this change, a call like `aclocal -I m4 --install' would 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. Closes automake bug#8168. * aclocal.in (install_file): Change signature: take 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. * NEWS: Update. * 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/Makefile.am (TESTS): Update. =46rom a report by Javier Jard=C3=B3n. =2D-- ChangeLog | 23 ++++++++++++ NEWS | 4 ++ THANKS | 1 + aclocal.in | 13 ++++--- tests/Makefile.am | 4 ++ tests/Makefile.in | 4 ++ tests/aclocal-install-fail.test | 52 ++++++++++++++++++++++++++ tests/aclocal-install-mkdir.test | 62 ++++++++++++++++++++++++++++= ++++ tests/aclocal-no-install-no-mkdir.test | 39 ++++++++++++++++++++ tests/aclocal-verbose-install.test | 53 +++++++++++++++++++++++++++ 10 files changed, 250 insertions(+), 5 deletions(-) create mode 100755 tests/aclocal-install-fail.test create mode 100755 tests/aclocal-install-mkdir.test create mode 100755 tests/aclocal-no-install-no-mkdir.test create mode 100755 tests/aclocal-verbose-install.test --Boundary-00=_EAnfNpjAuhFGI7d Content-Type: text/x-patch; charset="us-ascii"; name="0001-aclocal-I-does-not-bail-out-on-invalid-directories.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="0001-aclocal-I-does-not-bail-out-on-invalid-directories.patch" =46rom 7e00010b25459b62c62f011b0d4909313c131217 Mon Sep 17 00:00:00 2001 =46rom: Stefano Lattarini Date: Mon, 14 Mar 2011 17:06:49 +0100 Subject: [PATCH 1/2] aclocal: `-I' does not bail out on invalid directories. Related to automake bug#8168. * aclocal.in (scan_m4_dirs): If a user-specified "include directory" is unreadable or non-existent, do not issue a fatal error anymore, but simply issue a warning, and only when running in verbose mode. * NEWS: Update. * tests/aclocal-bad-dirlist-include-dir.test: New test. * tests/aclocal-bad-local-include-dir.test: Likewise. * tests/aclocal-bad-system-include-dir.test: Likewise. * tests/Makefile.am (TESTS): Update. * tests/.gitignore: Update. =2D-- ChangeLog | 15 +++++ NEWS | 5 ++ aclocal.in | 10 +++- tests/.gitignore | 4 +- tests/Makefile.am | 3 + tests/Makefile.in | 3 + tests/aclocal-bad-dirlist-include-dir.test | 36 +++++++++++ tests/aclocal-bad-local-include-dir.test | 90 ++++++++++++++++++++++++= ++++ tests/aclocal-bad-system-include-dir.test | 36 +++++++++++ 9 files changed, 199 insertions(+), 3 deletions(-) create mode 100755 tests/aclocal-bad-dirlist-include-dir.test create mode 100755 tests/aclocal-bad-local-include-dir.test create mode 100755 tests/aclocal-bad-system-include-dir.test diff --git a/ChangeLog b/ChangeLog index 804fae6..ed9f35b 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2011-03-14 Stefano Lattarini + + aclocal: `-I' does not bail out on invalid directories. + Related to automake bug#8168. + * aclocal.in (scan_m4_dirs): If a user-specified "include + directory" is unreadable or non-existent, do not issue a + fatal error anymore, but simply issue a warning, and only + when running in verbose mode. + * NEWS: Update. + * tests/aclocal-bad-dirlist-include-dir.test: New test. + * tests/aclocal-bad-local-include-dir.test: Likewise. + * tests/aclocal-bad-system-include-dir.test: Likewise. + * tests/Makefile.am (TESTS): Update. + * tests/.gitignore: Update. + 2011-03-04 Stefano Lattarini =20 tests: fix bug in alloca*.test diff --git a/NEWS b/NEWS index 3132b16..953e62a 100644 =2D-- a/NEWS +++ b/NEWS @@ -5,6 +5,11 @@ New in 1.11.0a: - The `lzma' compression scheme and associated automake option `dist-lzm= a' is obsoleted by `xz' and `dist-xz' due to upstream changes. =20 +* Changes to aclocal: + + - aclocal does not issue a fatal error anymore if one of the directories + specified with `-I' does not exist, or is not readable. + Bugs fixed in 1.11.0a: =20 * Bugs introduced by 1.11: diff --git a/aclocal.in b/aclocal.in index 2210fe3..3b9beab 100644 =2D-- a/aclocal.in +++ b/aclocal.in @@ -312,7 +312,15 @@ sub scan_m4_dirs ($@) { if (! opendir (DIR, $m4dir)) { =2D fatal "couldn't open directory `$m4dir': $!"; + if ($type =3D=3D FT_USER) + { + verb "cannot open directory `$m4dir': $!"; + next; + } + else + { + fatal "couldn't open directory `$m4dir': $!"; + } } =20 # We reverse the directory contents so that foo2.m4 gets diff --git a/tests/.gitignore b/tests/.gitignore index 3c1f990..5e97c89 100644 =2D-- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,5 +1,5 @@ =2Daclocal-* =2Dautomake-* +aclocal-1.* +automake-1.* defs parallel-tests.am *.dir diff --git a/tests/Makefile.am b/tests/Makefile.am index 3fdb90a..da4a037 100644 =2D-- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -59,6 +59,9 @@ acloca19.test \ acloca20.test \ acloca21.test \ acloca22.test \ +aclocal-bad-dirlist-include-dir.test \ +aclocal-bad-local-include-dir.test \ +aclocal-bad-system-include-dir.test \ acoutnoq.test \ acoutpt.test \ acoutpt2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index cd00833..6467f1a 100644 =2D-- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -329,6 +329,9 @@ acloca19.test \ acloca20.test \ acloca21.test \ acloca22.test \ +aclocal-bad-dirlist-include-dir.test \ +aclocal-bad-local-include-dir.test \ +aclocal-bad-system-include-dir.test \ acoutnoq.test \ acoutpt.test \ acoutpt2.test \ diff --git a/tests/aclocal-bad-dirlist-include-dir.test b/tests/aclocal-bad= =2Ddirlist-include-dir.test new file mode 100755 index 0000000..1b8df7d =2D-- /dev/null +++ b/tests/aclocal-bad-dirlist-include-dir.test @@ -0,0 +1,36 @@ +#! /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 . + +# Check that `aclocal' errors out when passed a non-readable directory +# with the `dirlist' file. + +. ./defs || Exit 1 + +set -e + +cat > configure.in <stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 +grep " couldn't open directory .*dirlist-test" stderr + +: diff --git a/tests/aclocal-bad-local-include-dir.test b/tests/aclocal-bad-l= ocal-include-dir.test new file mode 100755 index 0000000..680c754 =2D-- /dev/null +++ b/tests/aclocal-bad-local-include-dir.test @@ -0,0 +1,90 @@ +#! /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 . + +# Check that `aclocal' does not bail out when passed a non-existent +# or non-readable directory with the `-I' option. Also check that +# warns appropriately when `--verbose' is used. + +. ./defs || Exit 1 + +set -e + +cat > configure.in < m4/my-defs.m4 < unreadable/not-defs.m4 <stdout 2>stderr +} + +cwd=3D`pwd` || Exit 99 + +aclocal_call && test ! -s stdout && test ! -s stderr \ + || { cat stdout; cat stderr >&2; Exit 1; } + +$EGREP '(MY_MACRO|my-defs\.m4)' aclocal.m4 +$EGREP '(NOT_A_MACRO|not-defs\.m4)' aclocal.m4 && Exit 1 + +$AUTOCONF + +$FGREP MY_MACRO configure && Exit 1 +$FGREP my--macro--expansion configure +$FGREP NOT_A_MACRO configure +$FGREP invalid--expansion configure && Exit 1 + +aclocal_call --verbose || { cat stdout; cat stderr >&2; Exit 1; } +cat stdout +cat stderr >&2 + +for d in non-existent unreadable unopenable/sub private; do + grep " cannot open .*$d" stderr + grep " cannot open .*$cwd/$d" stderr +done + +: diff --git a/tests/aclocal-bad-system-include-dir.test b/tests/aclocal-bad-= system-include-dir.test new file mode 100755 index 0000000..f497d9e =2D-- /dev/null +++ b/tests/aclocal-bad-system-include-dir.test @@ -0,0 +1,36 @@ +#! /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 . + +# Check that `aclocal' errors out when passed a non-existent or +# non-readable directory with the `dirlist' file. + +. ./defs || Exit 1 + +set -e + +cat > configure.in <stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 +grep " couldn't open directory .*fake-acdir" stderr + +: =2D-=20 1.7.2.3 --Boundary-00=_EAnfNpjAuhFGI7d Content-Type: text/x-patch; charset="us-ascii"; name="0002-aclocal-create-local-directory-where-to-install-m4-f.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="0002-aclocal-create-local-directory-where-to-install-m4-f.patch" =46rom 8e31da6cb5712bc43181861c715cc2d4e1d8def7 Mon Sep 17 00:00:00 2001 =46rom: Stefano Lattarini Date: Mon, 14 Mar 2011 19:41:55 +0100 Subject: [PATCH 2/2] aclocal: create local directory where to install m4 fi= les MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Before this change, a call like `aclocal -I m4 --install' would 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. Closes automake bug#8168. * aclocal.in (install_file): Change signature: take 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. * NEWS: Update. * 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/Makefile.am (TESTS): Update. =46rom a report by Javier Jard=C3=B3n. =2D-- ChangeLog | 23 ++++++++++++ NEWS | 4 ++ THANKS | 1 + aclocal.in | 13 ++++--- tests/Makefile.am | 4 ++ tests/Makefile.in | 4 ++ tests/aclocal-install-fail.test | 52 ++++++++++++++++++++++++++ tests/aclocal-install-mkdir.test | 62 ++++++++++++++++++++++++++++= ++++ tests/aclocal-no-install-no-mkdir.test | 39 ++++++++++++++++++++ tests/aclocal-verbose-install.test | 53 +++++++++++++++++++++++++++ 10 files changed, 250 insertions(+), 5 deletions(-) create mode 100755 tests/aclocal-install-fail.test create mode 100755 tests/aclocal-install-mkdir.test create mode 100755 tests/aclocal-no-install-no-mkdir.test create mode 100755 tests/aclocal-verbose-install.test diff --git a/ChangeLog b/ChangeLog index ed9f35b..ae47a54 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,28 @@ 2011-03-14 Stefano Lattarini =20 + aclocal: create local directory where to install m4 files + Before this change, a call like `aclocal -I m4 --install' would + 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. + Closes automake bug#8168. + * aclocal.in (install_file): Change signature: take 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. + * NEWS: Update. + * 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/Makefile.am (TESTS): Update. + From a report by Javier Jard=C3=B3n. + +2011-03-14 Stefano Lattarini + aclocal: `-I' does not bail out on invalid directories. Related to automake bug#8168. * aclocal.in (scan_m4_dirs): If a user-specified "include diff --git a/NEWS b/NEWS index 953e62a..a1383b2 100644 =2D-- a/NEWS +++ b/NEWS @@ -10,6 +10,10 @@ New in 1.11.0a: - aclocal does not issue a fatal error anymore if one of the directories specified with `-I' does not exist, or is not readable. =20 + - 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: =20 * Bugs introduced by 1.11: diff --git a/THANKS b/THANKS index 60af1ee..fdf01b2 100644 =2D-- a/THANKS +++ b/THANKS @@ -144,6 +144,7 @@ Janos Farkas chexum@shadow.banki.hu Jared Davis abiword@aiksaurus.com Jason Duell jcduell@lbl.gov Jason Molenda crash@cygnus.co.jp +Javier Jard=C3=B3n jjardon@gnome.org Jeff Bailey Jbailey@phn.ca Jeff Garzik jgarzik@pobox.com Jeff Squyres jsquyres@lam-mpi.org diff --git a/aclocal.in b/aclocal.in index 3b9beab..bc582d6 100644 =2D-- a/aclocal.in +++ b/aclocal.in @@ -207,12 +207,15 @@ sub reset_maps () undef &search; } =20 =2D# install_file ($SRC, $DEST) +# install_file ($SRC, $DESTDIR) sub install_file ($$) { =2D my ($src, $dest) =3D @_; + my ($src, $destdir) =3D @_; + my $dest =3D $destdir . "/" . basename $src; my $diff_dest; =20 + verb "installing $src to $dest"; + if ($force_output || !exists $file_contents{$dest} || $file_contents{$src} ne $file_contents{$dest}) @@ -265,6 +268,8 @@ sub install_file ($$) } elsif (!$dry_run) { + xsystem ('mkdir', $destdir) + unless -d $destdir; xsystem ('cp', $src, $dest); } } @@ -778,9 +783,7 @@ sub write_aclocal ($@) my $dest; for my $ifile (@{$file_includes{$file}}, $file) { =2D $dest =3D "$user_includes[0]/" . basename $ifile; =2D verb "installing $ifile to $dest"; =2D install_file ($ifile, $dest); + install_file ($ifile, $user_includes[0]); } $installed =3D 1; } diff --git a/tests/Makefile.am b/tests/Makefile.am index da4a037..f3a1fb1 100644 =2D-- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -62,6 +62,10 @@ acloca22.test \ aclocal-bad-dirlist-include-dir.test \ aclocal-bad-local-include-dir.test \ aclocal-bad-system-include-dir.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 \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 6467f1a..40db068 100644 =2D-- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -332,6 +332,10 @@ acloca22.test \ aclocal-bad-dirlist-include-dir.test \ aclocal-bad-local-include-dir.test \ aclocal-bad-system-include-dir.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 \ diff --git a/tests/aclocal-install-fail.test b/tests/aclocal-install-fail.t= est new file mode 100755 index 0000000..7f672c0 =2D-- /dev/null +++ b/tests/aclocal-install-fail.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 . + +# Check that `aclocal --install' fails when it should. + +. ./defs || Exit 1 + +set -e + +cat > configure.in < dirlist-test/my-defs.m4 < a-regular-file +mkdir unwritable-dir +chmod a-w unwritable-dir + +ACLOCAL_TESTSUITE_FLAGS=3D'-I a-regular-file' $ACLOCAL --install 2>stderr \ + && { cat stderr >&2; Exit 1; } +cat stderr >&2 +grep 'mkdir:.*a-regular-file' stderr + +ACLOCAL_TESTSUITE_FLAGS=3D'-I unwritable-dir/sub' $ACLOCAL --install \ + 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 +grep 'mkdir:.*unwritable-dir/sub' stderr + +ACLOCAL_TESTSUITE_FLAGS=3D'-I unwritable-dir' $ACLOCAL --install 2>stderr \ + && { cat stderr >&2; Exit 1; } +cat stderr >&2 +grep 'cp:.*unwritable-dir' stderr + +: diff --git a/tests/aclocal-install-mkdir.test b/tests/aclocal-install-mkdir= =2Etest new file mode 100755 index 0000000..e727f59 =2D-- /dev/null +++ b/tests/aclocal-install-mkdir.test @@ -0,0 +1,62 @@ +#! /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 . + +# Check that `aclocal --install' create the local m4 directory if +# necessary. + +. ./defs || Exit 1 + +set -e + +cat > configure.in < dirlist-test/my-defs.m4 <. + +# Check that `aclocal' do not create non-existent local m4 directory +# if the `--install' option is not given. + +. ./defs || Exit 1 + +set -e + +cat > configure.in < dirlist-test/my-defs.m4 <. + +# Check verbose messages by `aclocal --install'. + +. ./defs || Exit 1 + +set -e + +cat > configure.in < dirlist-test/bar.m4 < dirlist-test/quux.m4 < foodir/bar.m4 + +ACLOCAL_TESTSUITE_FLAGS=3D'-I foodir' $ACLOCAL --install --verbose 2>stder= r \ + || { cat stderr >&2; Exit 1; } +cat stderr >&2 +grep ' installing .*dirlist-test/bar\.m4.* to .*foodir/bar\.m4' stderr +grep ' installing .*dirlist-test/quux\.m4.* to .*foodir/quux\.m4' stderr +grep ' overwriting .*foodir/bar\.m4.* with .*dirlist-test/bar\.m4' stderr +grep ' installing .*foodir/quux\.m4.* from .*dirlist-test/quux\.m4' stderr + +# Sanity checks. +ls -l foodir +grep MY_MACRO_BAR foodir/bar.m4 +grep MY_MACRO_QUUX foodir/quux.m4 + +: =2D-=20 1.7.2.3 --Boundary-00=_EAnfNpjAuhFGI7d-- From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 14 15:50:06 2011 Received: (at control) by debbugs.gnu.org; 14 Mar 2011 19:50:06 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PzDmH-0007z3-Sl for submit@debbugs.gnu.org; Mon, 14 Mar 2011 15:50:06 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PzDmF-0007yW-Mr for control@debbugs.gnu.org; Mon, 14 Mar 2011 15:50:04 -0400 Received: by wyb42 with SMTP id 42so4407703wyb.3 for ; Mon, 14 Mar 2011 12:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:mime-version :message-id:content-type:content-transfer-encoding; bh=Ps7yEdDdTkjKpUuubJBYbv3aB+NfGdBh11RJhJI8Ov4=; b=UBsIcT/t6AW/TS8VW1zDcQCXIUIH/OZ7+HGM+MFoBwwQG89Wg1G1WaAvpktG5z4Itg WnDdII5hJIYfPeZwJPRgKPmH51+mFMWLyjmKAkNJQ3UGeKN0Qa6DWWzcfODt4oY0Dkqu yUCmoeqZnm8F2xH3SZBcnzyoFOVh6egUViuFI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:message-id :content-type:content-transfer-encoding; b=E6hXiDgLvCsfrVGK4iMwFfnxQJAYvwHFfc5jFbkoygjS/FnoKhJcafd/jiMzBxxxyY hMJ+K3IMNGe+eOb+N647VRtLf32ZXmt786Zm65nJ5RTJjduCPwoWNDxC5w10cCgCy305 fnH+vC1WIf6Pu6dOwGkweCz7FlwbwPMoSDjVk= Received: by 10.227.139.19 with SMTP id c19mr6816172wbu.13.1300132197920; Mon, 14 Mar 2011 12:49:57 -0700 (PDT) Received: from bigio.localnet (host116-92-dynamic.2-87-r.retail.telecomitalia.it [87.2.92.116]) by mx.google.com with ESMTPS id w25sm6418417wbd.11.2011.03.14.12.49.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Mar 2011 12:49:57 -0700 (PDT) From: Stefano Lattarini To: control@debbugs.gnu.org Subject: automake bug#7833 and bug#8168: patches Date: Mon, 14 Mar 2011 20:49:39 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) MIME-Version: 1.0 Message-Id: <201103142049.39527.stefano.lattarini@gmail.com> Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Score: -3.9 (---) 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: -3.9 (---) tags 7833 patch tags 8168 patch thanks From unknown Mon Aug 18 11:15:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8168: macros directory not created automatically Resent-From: Javier =?UTF-8?Q?Jard=C3=B3n?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Tue, 15 Mar 2011 14:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8168 X-GNU-PR-Package: automake X-GNU-PR-Keywords: patch To: Stefano Lattarini Cc: 8168@debbugs.gnu.org, automake-patches@gnu.org Received: via spool by 8168-submit@debbugs.gnu.org id=B8168.130020003911805 (code B ref 8168); Tue, 15 Mar 2011 14:41:01 +0000 Received: (at 8168) by debbugs.gnu.org; 15 Mar 2011 14:40:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PzVQM-00034I-25 for submit@debbugs.gnu.org; Tue, 15 Mar 2011 10:40:38 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PzRXB-00055K-Kp for 8168@debbugs.gnu.org; Tue, 15 Mar 2011 06:31:26 -0400 Received: by wyb42 with SMTP id 42so344419wyb.3 for <8168@debbugs.gnu.org>; Tue, 15 Mar 2011 03:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:from :date:x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=CSrT8JP6OJkpDXCFYIBhklrV/EldFL7Ax+mvhoRwKzs=; b=oz7tfjmDahON5iCHeYcMkpAnXB/DGNOZYTD+rKhJxxOhxYUWBOt8wh2jDkK0ZtBMWt QG1wbvN6Zg6vPI1ZT37820QSjWi0jxwhwIg7qsMI89lO6AVLEje7a9lnDz2f5fGjnHrW njjiuDJEERUOtZTGo64G1MrFWk4y/2Tjuuww4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=cAsoDXnonaG8I6GfRJ4FUvkOLxUTVrEBU95SIXDpa/JFJ5lzxZRKZVFeE4ZAthl8SC 7fixNRf1Q7W2Xz54P64CHz1z5NatzL+39Og+TDRSAjjWR7lrZBTXpn8RNG2FsapAMfuC HTW5kZBs93BnlquUWg0JHH2hz1xAc/DoCyHuE= Received: by 10.216.210.231 with SMTP id u81mr11683685weo.65.1300185079890; Tue, 15 Mar 2011 03:31:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.73.193 with HTTP; Tue, 15 Mar 2011 03:30:55 -0700 (PDT) In-Reply-To: <201103142044.04195.stefano.lattarini@gmail.com> References: <201103032136.52231.stefano.lattarini@gmail.com> <201103142044.04195.stefano.lattarini@gmail.com> From: Javier =?UTF-8?Q?Jard=C3=B3n?= Date: Tue, 15 Mar 2011 11:30:55 +0100 X-Google-Sender-Auth: 2ORAsYvJwpTI0PacKcPEQto7uMo Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.6 (---) X-Mailman-Approved-At: Tue, 15 Mar 2011 10:40:36 -0400 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: -3.6 (---) On 14 March 2011 20:44, Stefano Lattarini wro= te: > [dropping automake list, adding automake-patches] > > References: > =C2=A0 > =C2=A0 > > -*-*- > > Hello Javier and all automakes, and sorry for the delay. > ... > > Javier, are you ok with your name being added to THANKS? Sure, but I do not know if my contribution is enough to be in that file ;) Thanks for working on this. Regards --=20 Javier Jard=C3=B3n Cabezas From unknown Mon Aug 18 11:15:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8168: macros directory not created automatically Resent-From: Ralf Wildenhues Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Fri, 01 Apr 2011 07:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8168 X-GNU-PR-Package: automake X-GNU-PR-Keywords: patch To: Stefano Lattarini Cc: 8168@debbugs.gnu.org, Javier =?UTF-8?Q?Jard=C3=B3n?= , automake-patches@gnu.org Received: via spool by 8168-submit@debbugs.gnu.org id=B8168.13016439532543 (code B ref 8168); Fri, 01 Apr 2011 07:46:02 +0000 Received: (at 8168) by debbugs.gnu.org; 1 Apr 2011 07:45:53 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5Z3I-0000ey-Ov for submit@debbugs.gnu.org; Fri, 01 Apr 2011 03:45:53 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Q5Z3F-0000ek-74 for 8168@debbugs.gnu.org; Fri, 01 Apr 2011 03:45:51 -0400 Received: (qmail invoked by alias); 01 Apr 2011 07:45:42 -0000 Received: from xdsl-78-35-59-247.netcologne.de (EHLO localhost.localdomain) [78.35.59.247] by mail.gmx.net (mp005) with SMTP; 01 Apr 2011 09:45:42 +0200 X-Authenticated: #13673931 X-Provags-ID: V01U2FsdGVkX1+5SL8NPW+5GDpfT/gTZNQ+twUdDILbXK9HH9kUln GfbOgIR15VDE1S Received: from ralf by localhost.localdomain with local (Exim 4.72) (envelope-from ) id 1Q5Z37-0005L3-Sv; Fri, 01 Apr 2011 09:45:41 +0200 Date: Fri, 1 Apr 2011 09:45:41 +0200 From: Ralf Wildenhues Message-ID: <20110401074541.GH14842@gmx.de> Mail-Followup-To: Stefano Lattarini , 8168@debbugs.gnu.org, Javier =?UTF-8?Q?Jard=C3=B3n?= , automake-patches@gnu.org References: <201103032136.52231.stefano.lattarini@gmail.com> <201103142044.04195.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201103142044.04195.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: -3.1 (---) 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: -3.1 (---) * Stefano Lattarini wrote on Mon, Mar 14, 2011 at 08:44:03PM CET: > > > Attached is a patch series (2 patches) that should address the issue. > The series is based off of maint -- as I'm not yet sure whether it > would be better to merge it to master only, or to maint too. > Ralf, OK to apply? I'm debating a couple of questions: Patch 2: - Should `--install -I foo/bar/m4' create intermediate directories, or would we suspect a typo? - Should `--install -I $dir' also create an absolute $dir? Does it with your patch? (I think "no" with both questions, but it would be good to be sure.) Patch 1: - Should the warning/erroring bits differentiate between relative or absolute directory names? I'm considering to not warn at all about absolute names, as we might not have any control over the tree there. - For a relative directory, a warning seems appropriate; and verb is not the right function for that. The most fitting category would be syntax, barring anything better? (And yes, that means aclocal -Werror would then error out, but that could be considered a good thing). But it seems 'verb' would be appropriate for absolute directories. What do you think? > If yes, where (maint, or master only)? Hmm, 1/2 can be seen as a bug fix, but I'd regard 2/2 as a new feature. Maybe base both of them off maint, and merge 1/2 to maint when we're done with the semantics? Further, a couple of trivial nits inline. Thanks, Ralf > Subject: [PATCH 1/2] aclocal: `-I' does not bail out on invalid directories. > > Related to automake bug#8168. > > * aclocal.in (scan_m4_dirs): If a user-specified "include > directory" is unreadable or non-existent, do not issue a > fatal error anymore, but simply issue a warning, and only > when running in verbose mode. > * NEWS: Update. > * tests/aclocal-bad-dirlist-include-dir.test: New test. > * tests/aclocal-bad-local-include-dir.test: Likewise. > * tests/aclocal-bad-system-include-dir.test: Likewise. > * tests/Makefile.am (TESTS): Update. > * tests/.gitignore: Update. > --- a/NEWS > +++ b/NEWS > @@ -5,6 +5,11 @@ New in 1.11.0a: > - The `lzma' compression scheme and associated automake option `dist-lzma' > is obsoleted by `xz' and `dist-xz' due to upstream changes. > > +* Changes to aclocal: > + > + - aclocal does not issue a fatal error anymore if one of the directories > + specified with `-I' does not exist, or is not readable. > + > Bugs fixed in 1.11.0a: > > * Bugs introduced by 1.11: > diff --git a/aclocal.in b/aclocal.in > index 2210fe3..3b9beab 100644 > --- a/aclocal.in > +++ b/aclocal.in > @@ -312,7 +312,15 @@ sub scan_m4_dirs ($@) > { > if (! opendir (DIR, $m4dir)) > { > - fatal "couldn't open directory `$m4dir': $!"; > + if ($type == FT_USER) > + { > + verb "cannot open directory `$m4dir': $!"; > + next; > + } > + else > + { > + fatal "couldn't open directory `$m4dir': $!"; > + } > } > > # We reverse the directory contents so that foo2.m4 gets > --- /dev/null > +++ b/tests/aclocal-bad-dirlist-include-dir.test Wouldn't "bad-dirlist-include" be a long-enough and precise-enough name? > +# Check that `aclocal' errors out when passed a non-readable directory > +# with the `dirlist' file. > + > +. ./defs || Exit 1 > + > +set -e > + > +cat > configure.in < +AC_INIT([$me], [1.0]) > +END > + > +mkdir dirlist-test > +chmod a-r dirlist-test > +ls -l disrlist-test && Exit 77 Typo disrlist > +$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; } Please add a comment before this line: # See the m4/dirlist file in the source tree. which I needed to understand why the test was working at all. > +cat stderr >&2 > +grep " couldn't open directory .*dirlist-test" stderr > --- /dev/null > +++ b/tests/aclocal-bad-local-include-dir.test > +# Check that `aclocal' does not bail out when passed a non-existent > +# or non-readable directory with the `-I' option. Also check that > +# warns appropriately when `--verbose' is used. The second sentence is missing a subject ('it'?). > +cat > configure.in < +AC_INIT([$me], [1.0]) > +MY_MACRO > +NOT_A_MACRO > +END > + > +mkdir m4 > +cat > m4/my-defs.m4 < +AC_DEFUN([MY_MACRO], [my--macro--expansion]) > +END > + > +mkdir unreadable unopenable unopenable/sub private > + > +cat > unreadable/not-defs.m4 < +AC_DEFUN([NOT_A_MACRO], [invalid--expansion]) > +END > +cp unreadable/not-defs.m4 unopenable/sub > +cp unreadable/not-defs.m4 private > + > +chmod a-r unreadable > +chmod a-x unopenable > +chmod a-rwx private > + > +ls -l unreadable && Exit 77 > +ls -l unopenable/sub && Exit 77 > +ls -l private && Exit 77 > + > +aclocal_call () > +{ > + $ACLOCAL -I m4 \ > + -I non-existent \ > + -I "$cwd"/non-existent \ > + -I unreadable \ > + -I "$cwd"/unreadable \ > + -I unopenable/sub \ > + -I "$cwd"/unopenable/sub \ > + -I private \ > + -I "$cwd"/private \ > + ${1+"$@"} >stdout 2>stderr > +} > + > +cwd=`pwd` || Exit 99 > + > +aclocal_call && test ! -s stdout && test ! -s stderr \ > + || { cat stdout; cat stderr >&2; Exit 1; } > + > +$EGREP '(MY_MACRO|my-defs\.m4)' aclocal.m4 > +$EGREP '(NOT_A_MACRO|not-defs\.m4)' aclocal.m4 && Exit 1 > + > +$AUTOCONF > + > +$FGREP MY_MACRO configure && Exit 1 > +$FGREP my--macro--expansion configure > +$FGREP NOT_A_MACRO configure > +$FGREP invalid--expansion configure && Exit 1 > + > +aclocal_call --verbose || { cat stdout; cat stderr >&2; Exit 1; } > +cat stdout > +cat stderr >&2 > + > +for d in non-existent unreadable unopenable/sub private; do > + grep " cannot open .*$d" stderr > + grep " cannot open .*$cwd/$d" stderr > +done > --- /dev/null > +++ b/tests/aclocal-bad-system-include-dir.test > +# Check that `aclocal' errors out when passed a non-existent or > +# non-readable directory with the `dirlist' file. > +cat > configure.in < +AC_INIT([$me], [1.0]) > +END > + > +mkdir fake-acdir > +chmod a-r fake-acdir > +ls -l fake-acdir && Exit 77 > + > +$ACLOCAL --acdir fake-acdir 2>stderr && { cat stderr >&2; Exit 1; } > +cat stderr >&2 > +grep " couldn't open directory .*fake-acdir" stderr > Subject: [PATCH 2/2] aclocal: create local directory where to install m4 files > Before this change, a call like `aclocal -I m4 --install' would > 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. > > Closes automake bug#8168. > > * aclocal.in (install_file): Change signature: take 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. > * NEWS: Update. > * 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/Makefile.am (TESTS): Update. > --- a/NEWS > +++ b/NEWS > @@ -10,6 +10,10 @@ New in 1.11.0a: > - aclocal does not issue a fatal error anymore if one of the directories > specified with `-I' does not exist, or is not readable. > > + - 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: > --- a/aclocal.in > +++ b/aclocal.in > @@ -207,12 +207,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}) > @@ -265,6 +268,8 @@ sub install_file ($$) > } > elsif (!$dry_run) > { > + xsystem ('mkdir', $destdir) > + unless -d $destdir; Perl has a mkdir function, there is no need for xsystem. > xsystem ('cp', $src, $dest); > } > } > @@ -778,9 +783,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; > } > --- /dev/null > +++ b/tests/aclocal-install-fail.test > +# Check that `aclocal --install' fails when it should. This test should use required=ro-dir I think. > +. ./defs || Exit 1 > + > +set -e > + > +cat > configure.in < +AC_INIT([$me], [1.0]) > +MY_MACRO > +END > + > +mkdir dirlist-test > +cat > dirlist-test/my-defs.m4 < +AC_DEFUN([MY_MACRO], [:]) > +END > + > +: > a-regular-file > +mkdir unwritable-dir > +chmod a-w unwritable-dir > + > +ACLOCAL_TESTSUITE_FLAGS='-I a-regular-file' $ACLOCAL --install 2>stderr \ > + && { cat stderr >&2; Exit 1; } > +cat stderr >&2 > +grep 'mkdir:.*a-regular-file' stderr > + > +ACLOCAL_TESTSUITE_FLAGS='-I unwritable-dir/sub' $ACLOCAL --install \ > + 2>stderr && { cat stderr >&2; Exit 1; } > +cat stderr >&2 > +grep 'mkdir:.*unwritable-dir/sub' stderr > + > +ACLOCAL_TESTSUITE_FLAGS='-I unwritable-dir' $ACLOCAL --install 2>stderr \ > + && { cat stderr >&2; Exit 1; } > +cat stderr >&2 > +grep 'cp:.*unwritable-dir' stderr > --- /dev/null > +++ b/tests/aclocal-install-mkdir.test > +# Check that `aclocal --install' create the local m4 directory if > +# necessary. > + > +. ./defs || Exit 1 > + > +set -e > + > +cat > configure.in < +AC_INIT([$me], [1.0]) > +MY_MACRO > +END > + > +mkdir dirlist-test > +cat > dirlist-test/my-defs.m4 < +AC_DEFUN([MY_MACRO], [:]) > +END > + > +ACLOCAL_TESTSUITE_FLAGS='-I foo' $ACLOCAL --install > +ls -l . foo > +test -f foo/my-defs.m4 > + > +cwd=`pwd` > +case $pwd in > + *$sp*|*$tab*) > + : cannot run this check > + ;; > + *) > + ACLOCAL_TESTSUITE_FLAGS="-I $cwd/bar" $ACLOCAL --install > + ls -l . bar > + test -f bar/my-defs.m4 > + ;; > +esac > + > +mkdir zardoz > +# What should happen: > +# * quux should be created, and required m4 files copied into there. > +# * zardoz shouldn't be preferred to quux, if if the former exists while > +# the latter does not. > +# * blah shouldn't be uselessly created. > +ACLOCAL_TESTSUITE_FLAGS='-I quux -I zardoz -I blah' $ACLOCAL --install > +ls -l . quux zardoz > +grep MY_MACRO quux/my-defs.m4 > +ls zardoz | grep . && Exit 1 > +test -d blah || test -r blah && Exit 1 > --- /dev/null > +++ b/tests/aclocal-no-install-no-mkdir.test > @@ -0,0 +1,39 @@ > +# Check that `aclocal' do not create non-existent local m4 directory s/do/does/ a non-existent > +# if the `--install' option is not given. > + > +. ./defs || Exit 1 > + > +set -e > + > +cat > configure.in < +AC_INIT([$me], [1.0]) > +MY_MACRO > +END > + > +mkdir dirlist-test > +cat > dirlist-test/my-defs.m4 < +AC_DEFUN([MY_MACRO], [:]) > +END > + > +# Ignore the exit status of aclocal; that is checked in other tests. Why? Can't hurt to also test that it fails, no? > +ACLOCAL_TESTSUITE_FLAGS='-I foo' $ACLOCAL -I bar || : > +test ! -d foo && test ! -r foo > +test ! -d bar && test ! -r bar > --- /dev/null > +++ b/tests/aclocal-verbose-install.test > +# Check verbose messages by `aclocal --install'. > + > +. ./defs || Exit 1 > + > +set -e > + > +cat > configure.in < +AC_INIT([$me], [1.0]) > +MY_MACRO_BAR > +MY_MACRO_QUUX > +END > + > +mkdir dirlist-test > +cat > dirlist-test/bar.m4 < +AC_DEFUN([MY_MACRO_BAR], [:]) > +END > +cat > dirlist-test/quux.m4 < +AC_DEFUN([MY_MACRO_QUUX], [:]) > +END > + > +mkdir foodir > +: > foodir/bar.m4 > + > +ACLOCAL_TESTSUITE_FLAGS='-I foodir' $ACLOCAL --install --verbose 2>stderr \ > + || { cat stderr >&2; Exit 1; } > +cat stderr >&2 > +grep ' installing .*dirlist-test/bar\.m4.* to .*foodir/bar\.m4' stderr > +grep ' installing .*dirlist-test/quux\.m4.* to .*foodir/quux\.m4' stderr > +grep ' overwriting .*foodir/bar\.m4.* with .*dirlist-test/bar\.m4' stderr > +grep ' installing .*foodir/quux\.m4.* from .*dirlist-test/quux\.m4' stderr > + > +# Sanity checks. > +ls -l foodir > +grep MY_MACRO_BAR foodir/bar.m4 > +grep MY_MACRO_QUUX foodir/quux.m4 From unknown Mon Aug 18 11:15:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8168: macros directory not created automatically Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Fri, 01 Apr 2011 13:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8168 X-GNU-PR-Package: automake X-GNU-PR-Keywords: patch To: Ralf Wildenhues Cc: 8168@debbugs.gnu.org, Javier =?UTF-8?Q?Jard=C3=B3n?= , automake-patches@gnu.org Received: via spool by 8168-submit@debbugs.gnu.org id=B8168.13016636211079 (code B ref 8168); Fri, 01 Apr 2011 13:14:02 +0000 Received: (at 8168) by debbugs.gnu.org; 1 Apr 2011 13:13:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5eAW-0000HM-Bm for submit@debbugs.gnu.org; Fri, 01 Apr 2011 09:13:40 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5eAS-0000H8-Sb for 8168@debbugs.gnu.org; Fri, 01 Apr 2011 09:13:39 -0400 Received: by wyb29 with SMTP id 29so2879475wyb.3 for <8168@debbugs.gnu.org>; Fri, 01 Apr 2011 06:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=NMSLrGyqwVTDT3EA5XUw3coj2jXByLgn5nW6syGlpHY=; b=Ch0FZ79vXmRnspB4t+/r4lsRyS1KYbVl0SXhBjbzyy7QO9RYVof+cuVQNnFXfoAISN 30O/2HNk/TEuQ6IpvHrvYjX+lypmYtbcnHirjXNxqiv3lI3PQDwHCRNHuZY74D1+eNVY rOLg6ELoSPUtc4vYVv+VchIDdff4S4ZRzQt9I= 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:content-transfer-encoding:message-id; b=Zd1GBd895sqzg46md+Ib19I/6kiHodcbvNxe6Wop3swSZWh0Ti/SiWTIs1h37YcQTs +d9ehm++yb9dhWA1oqS7Pp0n/TVJ7eK44R/vIe9PG408tV4DS74v1e/gqWyNAqSu+jxg sy0WjKd1HwxM6owq8vBV9k8R41ZvIScr8Tm5M= Received: by 10.216.138.66 with SMTP id z44mr4205781wei.87.1301663610854; Fri, 01 Apr 2011 06:13:30 -0700 (PDT) Received: from bigio.localnet (host37-94-dynamic.7-79-r.retail.telecomitalia.it [79.7.94.37]) by mx.google.com with ESMTPS id m73sm994954wej.16.2011.04.01.06.13.28 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Apr 2011 06:13:29 -0700 (PDT) From: Stefano Lattarini Date: Fri, 1 Apr 2011 15:13:19 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <201103142044.04195.stefano.lattarini@gmail.com> <20110401074541.GH14842@gmx.de> In-Reply-To: <20110401074541.GH14842@gmx.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201104011513.20037.stefano.lattarini@gmail.com> X-Spam-Score: -3.6 (---) 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: -3.6 (---) On Friday 01 April 2011, Ralf Wildenhues wrote: > * Stefano Lattarini wrote on Mon, Mar 14, 2011 at 08:44:03PM CET: > > > > > > > Attached is a patch series (2 patches) that should address the issue. > > The series is based off of maint -- as I'm not yet sure whether it > > would be better to merge it to master only, or to maint too. > > > Ralf, OK to apply? > > I'm debating a couple of questions: > > Patch 2: > - Should `--install -I foo/bar/m4' create intermediate directories, or > would we suspect a typo? > I'd say the latter. It should be good enough for the all legitimate uses, and will make the implementation slightly simpler (we can use the builtin function `mkdir' instead of the `mkpath' function from module File::Path). Also, in case the users start complaining about this limitation, we can still easily lift it, without breaking backward-compatibility. > - Should `--install -I $dir' also create an absolute $dir? > I think so. Why shouldn't it? > Does it with your patch? > Yes, and that is tested in `aclocal-install-mkdir.test'; see this hunk: cwd=`pwd` case $cwd in *$sp*|*$tab*) : cannot run this check ;; *) ACLOCAL_TESTSUITE_FLAGS="-I $cwd/bar" $ACLOCAL --install ls -l . bar test -f bar/my-defs.m4 ;; esac (Well, in fact there was a typo in this hunk, which I've corrected in the meantime; see below). > (I think "no" with both questions, but it would be good to be sure.) > The answer to both question is in truth "yes". Good you asked :-) > Patch 1: > - Should the warning/erroring bits differentiate between relative or > absolute directory names? I'm considering to not warn at all about > absolute names, as we might not have any control over the tree there. > I agree about not having a warning. But a message with `verb' (thus displayed only when the user requests verbose output) would be useful also in this case, no? > - For a relative directory, a warning seems appropriate; and verb is > not the right function for that. > Well, in truth, I didn't intend for that message to be a warning -- it's just a verbose mesage that can help in debugging. I think `verb' is appropriate for such an usage. Probably I should fix the ChangeLog entry to be more consistent with the intended behaviour; i.e., from * aclocal.in (scan_m4_dirs): If a user-specified "include directory" is unreadable or non-existent, do not issue a fatal error anymore, but simply issue a warning, and only when running in verbose mode. to: * aclocal.in (scan_m4_dirs): If a user-specified "include directory" is unreadable or non-existent, do not issue a fatal error anymore, but only give a proper message when running in verbose mode. Would that be better? > The most fitting category would be > syntax, barring anything better? (And yes, that means aclocal -Werror > would then error out, but that could be considered a good thing). > But it seems 'verb' would be appropriate for absolute directories. > > What do you think? > I think that we should behave similarly to how gcc, m4 and perl (and probably many other programs) behave -- i.e., no warning on `-I' used with non-existent directories, either relative or absolute: $ gcc -I /none foo.c $ m4 -I /none > If yes, where (maint, or master only)? > > Hmm, 1/2 can be seen as a bug fix, but I'd regard 2/2 as a new feature. > Maybe base both of them off maint, and merge 1/2 to maint when we're > done with the semantics? > Fine with me. > Further, a couple of trivial nits inline. > > Thanks, > Ralf > > Subject: [PATCH 1/2] aclocal: `-I' does not bail out on invalid directories. > > > > Related to automake bug#8168. > > > > * aclocal.in (scan_m4_dirs): If a user-specified "include > > directory" is unreadable or non-existent, do not issue a > > fatal error anymore, but simply issue a warning, and only > > when running in verbose mode. > > * NEWS: Update. > > * tests/aclocal-bad-dirlist-include-dir.test: New test. > > * tests/aclocal-bad-local-include-dir.test: Likewise. > > * tests/aclocal-bad-system-include-dir.test: Likewise. > > * tests/Makefile.am (TESTS): Update. > > * tests/.gitignore: Update. > > --- /dev/null > > +++ b/tests/aclocal-bad-dirlist-include-dir.test > > Wouldn't "bad-dirlist-include" be a long-enough and precise-enough name? > Hmm... I prefero to keep the `aclocal' in there, to keep the test names esier to search. So I went for `aclocal-bad-dirlist-incl.test'. Similarly for the other two tests. > > +# Check that `aclocal' errors out when passed a non-readable directory > > +# with the `dirlist' file. > > + > > +. ./defs || Exit 1 > > + > > +set -e > > + > > +cat > configure.in < > +AC_INIT([$me], [1.0]) > > +END > > + > > +mkdir dirlist-test > > +chmod a-r dirlist-test > > +ls -l disrlist-test && Exit 77 > > Typo disrlist > Oops, well spotted. Fixed. > > +$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; } > > Please add a comment before this line: > # See the m4/dirlist file in the source tree. > > which I needed to understand why the test was working at all. > Done (and I agree the comment is useful). > > +cat stderr >&2 > > +grep " couldn't open directory .*dirlist-test" stderr > > --- /dev/null > > +++ b/tests/aclocal-bad-local-include-dir.test > > > +# Check that `aclocal' does not bail out when passed a non-existent > > +# or non-readable directory with the `-I' option. Also check that > > +# warns appropriately when `--verbose' is used. > > The second sentence is missing a subject ('it'?). > Yep. Fixed. > > Subject: [PATCH 2/2] aclocal: create local directory where to install m4 files > > > Before this change, a call like `aclocal -I m4 --install' would > > 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. > > > > Closes automake bug#8168. > > > > * aclocal.in (install_file): Change signature: take 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. > > * NEWS: Update. > > * 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/Makefile.am (TESTS): Update. > > > --- a/NEWS > > +++ b/NEWS > > @@ -10,6 +10,10 @@ New in 1.11.0a: > > - aclocal does not issue a fatal error anymore if one of the directories > > specified with `-I' does not exist, or is not readable. > > > > + - 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: > > > --- a/aclocal.in > > +++ b/aclocal.in > > @@ -207,12 +207,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}) > > @@ -265,6 +268,8 @@ sub install_file ($$) > > } > > elsif (!$dry_run) > > { > > + xsystem ('mkdir', $destdir) > > + unless -d $destdir; > > Perl has a mkdir function, there is no need for xsystem. > Agreed (and testcases updated accordingly). > > xsystem ('cp', $src, $dest); > > } > > } > > @@ -778,9 +783,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; > > } > > --- /dev/null > > +++ b/tests/aclocal-install-fail.test > > > +# Check that `aclocal --install' fails when it should. > > This test should use required=ro-dir I think. > Agreed. Fixed. > > +. ./defs || Exit 1 > > + > > +set -e > > + > > +cat > configure.in < > +AC_INIT([$me], [1.0]) > > +MY_MACRO > > +END > > + > > +mkdir dirlist-test > > +cat > dirlist-test/my-defs.m4 < > +AC_DEFUN([MY_MACRO], [:]) > > +END > > + > > +: > a-regular-file > > +mkdir unwritable-dir > > +chmod a-w unwritable-dir > > + > > +ACLOCAL_TESTSUITE_FLAGS='-I a-regular-file' $ACLOCAL --install 2>stderr \ > > + && { cat stderr >&2; Exit 1; } > > +cat stderr >&2 > > +grep 'mkdir:.*a-regular-file' stderr > > + > > +ACLOCAL_TESTSUITE_FLAGS='-I unwritable-dir/sub' $ACLOCAL --install \ > > + 2>stderr && { cat stderr >&2; Exit 1; } > > +cat stderr >&2 > > +grep 'mkdir:.*unwritable-dir/sub' stderr > > + > > +ACLOCAL_TESTSUITE_FLAGS='-I unwritable-dir' $ACLOCAL --install 2>stderr \ > > + && { cat stderr >&2; Exit 1; } > > +cat stderr >&2 > > +grep 'cp:.*unwritable-dir' stderr > > --- /dev/null > > +++ b/tests/aclocal-install-mkdir.test > > > +# Check that `aclocal --install' create the local m4 directory if > > +# necessary. > > + > > +. ./defs || Exit 1 > > + > > +set -e > > + > > +cat > configure.in < > +AC_INIT([$me], [1.0]) > > +MY_MACRO > > +END > > + > > +mkdir dirlist-test > > +cat > dirlist-test/my-defs.m4 < > +AC_DEFUN([MY_MACRO], [:]) > > +END > > + > > +ACLOCAL_TESTSUITE_FLAGS='-I foo' $ACLOCAL --install > > +ls -l . foo > > +test -f foo/my-defs.m4 > > + > > +cwd=`pwd` > > +case $pwd in > This should be `$cwd'. Fixed. > > + *$sp*|*$tab*) > > + : cannot run this check > > + ;; > > + *) > > + ACLOCAL_TESTSUITE_FLAGS="-I $cwd/bar" $ACLOCAL --install > > + ls -l . bar > > + test -f bar/my-defs.m4 > > + ;; > > +esac > > + > > +mkdir zardoz > > +# What should happen: > > +# * quux should be created, and required m4 files copied into there. > > +# * zardoz shouldn't be preferred to quux, if if the former exists while > > +# the latter does not. > > +# * blah shouldn't be uselessly created. > > +ACLOCAL_TESTSUITE_FLAGS='-I quux -I zardoz -I blah' $ACLOCAL --install > > +ls -l . quux zardoz > > +grep MY_MACRO quux/my-defs.m4 > > +ls zardoz | grep . && Exit 1 > > +test -d blah || test -r blah && Exit 1 > > --- /dev/null > > +++ b/tests/aclocal-no-install-no-mkdir.test > > @@ -0,0 +1,39 @@ > > > +# Check that `aclocal' do not create non-existent local m4 directory > > s/do/does/ > a non-existent > Fixed. > > +# if the `--install' option is not given. > > + > > +. ./defs || Exit 1 > > + > > +set -e > > + > > +cat > configure.in < > +AC_INIT([$me], [1.0]) > > +MY_MACRO > > +END > > + > > +mkdir dirlist-test > > +cat > dirlist-test/my-defs.m4 < > +AC_DEFUN([MY_MACRO], [:]) > > +END > > + > > +# Ignore the exit status of aclocal; that is checked in other tests. > > Why? > Better separation of concerns between different tests (sorta). > Can't hurt to also test that it fails, no? > As you prefer -- I really have no strong feelings here. > > +ACLOCAL_TESTSUITE_FLAGS='-I foo' $ACLOCAL -I bar || : > > +test ! -d foo && test ! -r foo > > +test ! -d bar && test ! -r bar > Thanks, Stefano From unknown Mon Aug 18 11:15:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8168: macros directory not created automatically Resent-From: Ralf Wildenhues Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Fri, 01 Apr 2011 13:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8168 X-GNU-PR-Package: automake X-GNU-PR-Keywords: patch To: Stefano Lattarini Cc: 8168@debbugs.gnu.org, Javier =?UTF-8?Q?Jard=C3=B3n?= , automake-patches@gnu.org Received: via spool by 8168-submit@debbugs.gnu.org id=B8168.13016644192188 (code B ref 8168); Fri, 01 Apr 2011 13:27:01 +0000 Received: (at 8168) by debbugs.gnu.org; 1 Apr 2011 13:26:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5eNP-0000ZE-2H for submit@debbugs.gnu.org; Fri, 01 Apr 2011 09:26:59 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Q5eNL-0000Yz-BQ for 8168@debbugs.gnu.org; Fri, 01 Apr 2011 09:26:57 -0400 Received: (qmail invoked by alias); 01 Apr 2011 13:26:49 -0000 Received: from xdsl-89-0-84-59.netcologne.de (EHLO localhost.localdomain) [89.0.84.59] by mail.gmx.net (mp023) with SMTP; 01 Apr 2011 15:26:49 +0200 X-Authenticated: #13673931 X-Provags-ID: V01U2FsdGVkX19PRbckDGpP3b4gNKSrMYGTyHD4bUrO/fX8ebqgeE VYcc5d2dENEY+D Received: from ralf by localhost.localdomain with local (Exim 4.72) (envelope-from ) id 1Q5eNE-0003dg-1m; Fri, 01 Apr 2011 15:26:48 +0200 Date: Fri, 1 Apr 2011 15:26:47 +0200 From: Ralf Wildenhues Message-ID: <20110401132647.GD26736@gmx.de> Mail-Followup-To: Stefano Lattarini , 8168@debbugs.gnu.org, Javier =?UTF-8?Q?Jard=C3=B3n?= , automake-patches@gnu.org References: <201103142044.04195.stefano.lattarini@gmail.com> <20110401074541.GH14842@gmx.de> <201104011513.20037.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201104011513.20037.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-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.8 (--) * Stefano Lattarini wrote on Fri, Apr 01, 2011 at 03:13:19PM CEST: > On Friday 01 April 2011, Ralf Wildenhues wrote: > > Patch 2: > > - Should `--install -I foo/bar/m4' create intermediate directories, or > > would we suspect a typo? > > > I'd say the latter. It should be good enough for the all legitimate uses, > and will make the implementation slightly simpler (we can use the builtin > function `mkdir' instead of the `mkpath' function from module File::Path). > Also, in case the users start complaining about this limitation, we can > still easily lift it, without breaking backward-compatibility. OK. > > - Should `--install -I $dir' also create an absolute $dir? > > > I think so. Why shouldn't it? Well, I don't understand what a legitimate use case would be, that's why. You need a relative path anyway for --install to copy files there. aclocal won't install to an absolute first -I directory, because that is usually not what was intended (it typically comes from having to work around the non-existence of ACLOCAL_PATH by specifying ACLOCAL='aclocal -I /some/system/dir'). Do you see know what it may not be a good idea to try to create such a directory? > > (I think "no" with both questions, but it would be good to be sure.) > > > The answer to both question is in truth "yes". Good you asked :-) > > Patch 1: > > - Should the warning/erroring bits differentiate between relative or > > absolute directory names? I'm considering to not warn at all about > > absolute names, as we might not have any control over the tree there. > > > I agree about not having a warning. But a message with `verb' (thus > displayed only when the user requests verbose output) would be useful > also in this case, no? Sure. > > - For a relative directory, a warning seems appropriate; and verb is > > not the right function for that. > > > Well, in truth, I didn't intend for that message to be a warning -- it's > just a verbose mesage that can help in debugging. I think `verb' is > appropriate for such an usage. Probably I should fix the ChangeLog > entry to be more consistent with the intended behaviour; i.e., from > > * aclocal.in (scan_m4_dirs): If a user-specified "include > directory" is unreadable or non-existent, do not issue a > fatal error anymore, but simply issue a warning, and only > when running in verbose mode. > > to: > > * aclocal.in (scan_m4_dirs): If a user-specified "include > directory" is unreadable or non-existent, do not issue a > fatal error anymore, but only give a proper message when > running in verbose mode. > > Would that be better? But why would a warning be inappropriate? It can be turned off, and it can signal a command-line typo. Very few users use --verbose, and those that do, do not run it in order to get notified of typos. We don't have to work identical to a preprocessor here. Unlike a preprocessor, aclocal is much more at the whim of bogus (or missing) macro files, because we scan all files in a directory, not just explicitly included ones, so some control over the search path is a good thing in general. > > The most fitting category would be > > syntax, barring anything better? (And yes, that means aclocal -Werror > > would then error out, but that could be considered a good thing). > > But it seems 'verb' would be appropriate for absolute directories. > > > > What do you think? > > > I think that we should behave similarly to how gcc, m4 and perl (and > probably many other programs) behave -- i.e., no warning on `-I' used > with non-existent directories, either relative or absolute: > $ gcc -I /none foo.c > $ m4 -I /none $ perl -I /none -e '1;' See above. > > > + xsystem ('mkdir', $destdir) > > > + unless -d $destdir; > > > > Perl has a mkdir function, there is no need for xsystem. > > > Agreed (and testcases updated accordingly). Be sure to check for errors. Thanks, Ralf From unknown Mon Aug 18 11:15:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8168: macros directory not created automatically Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Fri, 01 Apr 2011 13:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8168 X-GNU-PR-Package: automake X-GNU-PR-Keywords: patch To: Ralf Wildenhues Cc: 8168@debbugs.gnu.org, Javier =?UTF-8?Q?Jard=C3=B3n?= , automake-patches@gnu.org Received: via spool by 8168-submit@debbugs.gnu.org id=B8168.13016661635058 (code B ref 8168); Fri, 01 Apr 2011 13:57:02 +0000 Received: (at 8168) by debbugs.gnu.org; 1 Apr 2011 13:56:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5epW-0001JX-UK for submit@debbugs.gnu.org; Fri, 01 Apr 2011 09:56:03 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5epU-0001J1-PI for 8168@debbugs.gnu.org; Fri, 01 Apr 2011 09:56:01 -0400 Received: by wyb29 with SMTP id 29so2916635wyb.3 for <8168@debbugs.gnu.org>; Fri, 01 Apr 2011 06:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=V+xRRlz/NgNEOwm4gcW16ARhxU2/Z0jkeOAypOhFHUA=; b=w4J9XaWMsPPHU9hQPPyscJvcKcG+wKTt+L6UqWjrvk7d6FW0STXu8OKPqKXaUAy/j6 r4DRbNcLGbyPrJSx1UI+6J8zt8vP9CLuhWfB4x89oVHq+icD3XmXWUmxj5r77hgT01k2 SVEj8f3L0MlNAyotISG30DeePtZ898Fnktd4Q= 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:content-transfer-encoding:message-id; b=A89ZruuISvrE8uLkoU1rW6OQIalGOyKGZUjr8KeCNFOb/fx3A5Xf6lidCvFFUPHrLk 49KS14wKKbXFqiSoIwWwPyJmV30/I/1Q7fbEE9pyj3n7ksCYWcWQ9iBQQKPoxPrGi5sn oUX9XEolHZrgWwUVHdX2u/MaeZY4n6+VvZc8s= Received: by 10.216.60.196 with SMTP id u46mr844857wec.113.1301666154937; Fri, 01 Apr 2011 06:55:54 -0700 (PDT) Received: from bigio.localnet (host37-94-dynamic.7-79-r.retail.telecomitalia.it [79.7.94.37]) by mx.google.com with ESMTPS id o6sm1288253wbo.3.2011.04.01.06.55.53 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Apr 2011 06:55:54 -0700 (PDT) From: Stefano Lattarini Date: Fri, 1 Apr 2011 15:55:44 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <201104011513.20037.stefano.lattarini@gmail.com> <20110401132647.GD26736@gmx.de> In-Reply-To: <20110401132647.GD26736@gmx.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201104011555.44881.stefano.lattarini@gmail.com> X-Spam-Score: -3.6 (---) 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: -3.6 (---) On Friday 01 April 2011, Ralf Wildenhues wrote: > * Stefano Lattarini wrote on Fri, Apr 01, 2011 at 03:13:19PM CEST: > > On Friday 01 April 2011, Ralf Wildenhues wrote: > > > Patch 2: > > > - Should `--install -I $dir' also create an absolute $dir? > > > > > I think so. Why shouldn't it? > > Well, I don't understand what a legitimate use case would be, that's > why. You need a relative path anyway for --install to copy files there. > aclocal won't install to an absolute first -I directory, because that > is usually not what was intended > Ahhh, now your position makes perfect sense, and I agree with it. I'll fix the patch and the testuite shortly(ish). BTW, I dimly remembered some non-obvious interaction between `--install' and absolute dirnames, and I had looked at the documentation searching for it before answering your previous, but nothing came up. Now I see that the behaviour is indeed documented, but not in a completely "appropriate" place (it's only in the introduction to aclocal, not in the documentation of the `--install' option). Maybe this could be improved. > (it typically comes from having to work > around the non-existence of ACLOCAL_PATH by specifying ACLOCAL='aclocal > -I /some/system/dir'). > > Do you see know what it may not be a good idea to try to create such a > directory? > Yes, and I agree with you now. > > > Patch 1: > > > - For a relative directory, a warning seems appropriate; and verb is > > > not the right function for that. > > > > > Well, in truth, I didn't intend for that message to be a warning -- it's > > just a verbose mesage that can help in debugging. I think `verb' is > > appropriate for such an usage. Probably I should fix the ChangeLog > > entry to be more consistent with the intended behaviour; i.e., from > > > > * aclocal.in (scan_m4_dirs): If a user-specified "include > > directory" is unreadable or non-existent, do not issue a > > fatal error anymore, but simply issue a warning, and only > > when running in verbose mode. > > > > to: > > > > * aclocal.in (scan_m4_dirs): If a user-specified "include > > directory" is unreadable or non-existent, do not issue a > > fatal error anymore, but only give a proper message when > > running in verbose mode. > > > > Would that be better? > > But why would a warning be inappropriate? It can be turned off, > Only turning off other warnings too ... > and it can signal a command-line typo. Very few users use --verbose, > and those that do, do not run it in order to get notified of typos. > Maybe a new warning category could be introduced? > We don't have to work identical to a preprocessor here. Unlike a > preprocessor, aclocal is much more at the whim of bogus (or missing) > macro files, because we scan all files in a directory, not just > explicitly included ones, so some control over the search path is a > good thing in general. > OK, you have a point here. > > > The most fitting category would be syntax, barring anything > > > better? > But we would need something better IMHO. > > > (And yes, that means aclocal -Werror > > > would then error out, but that could be considered a good thing). > Yes, but only if the warning categories have a sufficient granularity. > > > But it seems 'verb' would be appropriate for absolute directories. > > > > + xsystem ('mkdir', $destdir) > > > > + unless -d $destdir; > > > > > > Perl has a mkdir function, there is no need for xsystem. > > > > > Agreed (and testcases updated accordingly). > > Be sure to check for errors. > I did (and the testsuite would have caught a missing check anyway ;-) Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 15 12:30:46 2012 Received: (at control) by debbugs.gnu.org; 15 Mar 2012 16:30:46 +0000 Received: from localhost ([127.0.0.1]:52249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8DZc-0000oM-93 for submit@debbugs.gnu.org; Thu, 15 Mar 2012 12:30:45 -0400 Received: from mail-bk0-f44.google.com ([209.85.214.44]:40785) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8DZV-0000lK-06 for control@debbugs.gnu.org; Thu, 15 Mar 2012 12:30:41 -0400 Received: by bkuw5 with SMTP id w5so2199677bku.3 for ; Thu, 15 Mar 2012 09:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:subject:content-type :content-transfer-encoding; bh=kZzKmqyTkDIDjE5OpkpZHWiP2OZVaY7Sso6OA+IMI88=; b=PIfUxhysEGuaK+9i6kIuIZmJEc7QoC/PyQbg63DliSJrCe0DKp7dBlKouVj/KDwVGM 9H480i2Z1DD6o5kDEG56kxr9715IfWdHOqpWrdzglFtmkKcjFZoxTErOeIDgXgXNhi1f qCnzZOyXr53ZqYqxZShj3ftddhd9jy4KejBihHefvZ0PaZwGHN5VCH/2IOlhX1Kem7Zq VaZZGZzEHTEh/YPMgqS5D9Aby9SB01tODqkGRCzCQgpryoPDHUGe2UoH3Yws5Oxvdimp MXTWL4sdMCDKIY/fDuWATR1jShVZn94QZltWJMx70h0MtK3IQyEVzdwWAjSmSMT2Btyo 1Bzg== Received: by 10.204.154.2 with SMTP id m2mr2638145bkw.110.1331827227899; Thu, 15 Mar 2012 09:00:27 -0700 (PDT) Received: from [82.60.30.174] (host174-30-dynamic.60-82-r.retail.telecomitalia.it. [82.60.30.174]) by mx.google.com with ESMTPS id f5sm4567065bke.9.2012.03.15.09.00.24 (version=SSLv3 cipher=OTHER); Thu, 15 Mar 2012 09:00:25 -0700 (PDT) Message-ID: <4F621216.9050900@gmail.com> Date: Thu, 15 Mar 2012 17:00:22 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: foo Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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.6 (--) severity 8168 wishlist tags 10816 patch merge 10816 8168 thanks From unknown Mon Aug 18 11:15:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8168: [PATCH] aclocal: create local directory where to install m4 files References: <201103032136.52231.stefano.lattarini@gmail.com> In-Reply-To: <201103032136.52231.stefano.lattarini@gmail.com> Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Thu, 15 Mar 2012 20:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8168 X-GNU-PR-Package: automake X-GNU-PR-Keywords: patch To: automake-patches@gnu.org Cc: 8168@debbugs.gnu.org, dwheeler@dwheeler.com, jjardon@gnome.org, 10816@debbugs.gnu.org Received: via spool by 8168-submit@debbugs.gnu.org id=B8168.133184328127395 (code B ref 8168); Thu, 15 Mar 2012 20:29:01 +0000 Received: (at 8168) by debbugs.gnu.org; 15 Mar 2012 20:28:01 +0000 Received: from localhost ([127.0.0.1]:52365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8HHE-00077W-9p for submit@debbugs.gnu.org; Thu, 15 Mar 2012 16:28:01 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:57866) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S8HGz-000774-Kb; Thu, 15 Mar 2012 16:27:57 -0400 Received: by werb10 with SMTP id b10so3791787wer.3 for ; Thu, 15 Mar 2012 12:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=5+hfO2UGMtVawQEv4y7vpbmpcBxS7yrerQAFOf3q89k=; b=ZzquJgghlnIBFWZbcHwVc2W9PVrQSw6NLOx1ATeEQnxatuOJhVcHAh/nd9SPLHmVHK XDkoqZMu8RE3quOvJNJxuD1c+NsUIi21pcjGwL9r6JHzj3SIT7Lnu131hZlULIMj6umm uc45VreZVx4yCnbUlFHv0W+PgDSMdfxi0EFZ34nhgtCR+krYWRjylVw25wKH3cvzkM0a QEhWQeT/z1Fk7X3AXb2Adh8HE63yXRGfBwvyFfpfwvusO6ouLBkWp42XnCJPWPQGv56y uKN+OW/zr9SO+rV1/ogY9tGwnTxvMcOuvYLQZEdqmJk+7lmO01QEOEFOwxYi70JCKfbs BuFw== Received: by 10.180.91.10 with SMTP id ca10mr29221136wib.17.1331841455152; Thu, 15 Mar 2012 12:57:35 -0700 (PDT) Received: from localhost.localdomain (host40-92-dynamic.4-87-r.retail.telecomitalia.it. [87.4.92.40]) by mx.google.com with ESMTPS id k6sm7531186wiy.7.2012.03.15.12.57.32 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Mar 2012 12:57:33 -0700 (PDT) From: Stefano Lattarini Date: Thu, 15 Mar 2012 20:57:22 +0100 Message-Id: <9c7254b76bc0016595bf3815213e6c83b62f7a39.1331841335.git.stefano.lattarini@gmail.com> X-Mailer: git-send-email 1.7.9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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.6 (--) 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 in ... (install_file): ... here. Change signature: 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. * 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 --- I will push this in a couple of days if there is no objection. Thanks to David and Javier, and sorry for the awful delay. Regards, Stefano NEWS | 4 ++ THANKS | 2 + aclocal.in | 40 +++++++++++++++---- tests/aclocal-install-fail.test | 65 ++++++++++++++++++++++++++++++++ tests/aclocal-install-mkdir.test | 62 ++++++++++++++++++++++++++++++ tests/aclocal-no-install-no-mkdir.test | 39 +++++++++++++++++++ tests/aclocal-verbose-install.test | 54 ++++++++++++++++++++++++++ tests/list-of-tests.mk | 4 ++ 8 files changed, 261 insertions(+), 9 deletions(-) create mode 100755 tests/aclocal-install-fail.test create mode 100755 tests/aclocal-install-mkdir.test create mode 100755 tests/aclocal-no-install-no-mkdir.test create mode 100755 tests/aclocal-verbose-install.test 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 brolley@redhat.com Dave Korn dave.korn.cygwin@googlemail.com Dave Morrison dave@bnl.gov David A. Swierczek swiercze@mr.med.ge.com +David A. Wheeler dwheeler@dwheeler.com David Byron dbyron@dbyron.com Davyd Madeley davyd@fugro-fsi.com.au David Pashley david@davidpashley.com @@ -149,6 +150,7 @@ Janos Farkas chexum@shadow.banki.hu Jared Davis abiword@aiksaurus.com Jason Duell jcduell@lbl.gov Jason Molenda crash@cygnus.co.jp +Javier Jardón jjardon@gnome.org Jeff Bailey Jbailey@phn.ca Jeff Garzik jgarzik@pobox.com Jeff Squyres jsquyres@lam-mpi.org diff --git a/aclocal.in b/aclocal.in index ed1d8d9..ca15732 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 @@ -45,6 +43,7 @@ use Automake::FileUtils; use File::Basename; use File::stat; use Cwd; +use File::Path (); # Some globals. @@ -181,6 +180,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 +220,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 +281,7 @@ sub install_file ($$) } elsif (!$dry_run) { + xmkdir_p ($destdir); xsystem ('cp', $src, $dest); } } @@ -307,6 +321,7 @@ sub list_compare (\@\@) # -------------------------- # 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 +330,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 +797,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 . + +# 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 < sys-acdir/my-defs.m4 < 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..61a3d19 --- /dev/null +++ b/tests/aclocal-install-mkdir.test @@ -0,0 +1,62 @@ +#! /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 . + +# 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 < sys-acdir/my-defs.m4 <. + +# 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 < sys-acdir/my-defs.m4 <. + +# Check verbose messages by `aclocal --install'. + +am_create_testdir=empty +. ./defs || Exit 1 + +set -e + +cat > configure.in < sys-acdir/bar.m4 < sys-acdir/quux.m4 < 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 \ -- 1.7.9