From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 22 14:46:40 2011 Received: (at submit) by debbugs.gnu.org; 22 Sep 2011 18:46:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R6oIB-0000gk-QF for submit@debbugs.gnu.org; Thu, 22 Sep 2011 14:46:40 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R6oF9-0000bs-3f for submit@debbugs.gnu.org; Thu, 22 Sep 2011 14:43:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6oEl-0004an-Dh for submit@debbugs.gnu.org; Thu, 22 Sep 2011 14:43:08 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, URIBL_BLACK autolearn=no version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:48701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6oEl-0004aj-CB for submit@debbugs.gnu.org; Thu, 22 Sep 2011 14:43:07 -0400 Received: from eggs.gnu.org ([140.186.70.92]:58707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6oEk-0003nF-6V for bug-automake@gnu.org; Thu, 22 Sep 2011 14:43:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6oEi-0004aX-Ov for bug-automake@gnu.org; Thu, 22 Sep 2011 14:43:06 -0400 Received: from mail.elliptictech.com ([209.217.122.41]:41573 helo=mail.ellipticsemi.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6oEi-0004aP-Kl for bug-automake@gnu.org; Thu, 22 Sep 2011 14:43:04 -0400 Received: from nbowler by mail.ellipticsemi.com with local (Exim 4.76) (envelope-from ) id 1R6oEd-000433-HL for bug-automake@gnu.org; Thu, 22 Sep 2011 14:42:59 -0400 Date: Thu, 22 Sep 2011 14:42:59 -0400 From: Nick Bowler To: bug-automake@gnu.org Subject: make uninstall fails after make install-data in empty prefix. Message-ID: <20110922184259.GA8608@elliptictech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: Elliptic Technologies Inc. User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 22 Sep 2011 14:46:38 -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: -4.6 (----) Hello, I noticed a problem testing the uninstall target of my automake-generated Makefiles. If the install prefix does not exist before installation, automake will create the necessary directories. But if you run a plain "make install-data" (without make install-exec), the directories for executables are (unsurprisingly) not created. The problem is that "make uninstall" fails in this case: % ./configure --prefix=/tmp/does_not_exist % make install-data % make uninstall ( cd '/tmp/does_not_exist/bin' && rm -f foo ) /bin/sh: line 6: cd: /tmp/does_not_exist/bin: No such file or directory make: *** [uninstall-binPROGRAMS] Error 1 and the installed data files are not deleted. For reference, here's the generated uninstall-binPROGRAMS target: uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files Manually adding a - before the second command corrects the issue and the data is successfully uninstalled. A similar problem occurs with "make install-exec" followed by "make uninstall", although this is somewhat less severe because GNU make will successfully uninstall the executables before failing when it gets to the data. I'm using autoconf-2.68 and automake-1.11.1; the problem also occurs with latest git automake at the time of writing. The above was reproduced with the following: % cat >Makefile.am <<'EOF' bin_PROGRAMS = foo data_DATA = bar EOF % cat >configure.ac <<'EOF' AC_INIT([test], [1.0]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_PROG_CC AC_CONFIG_FILES([Makefile]) AC_OUTPUT EOF % cat >foo.c <<'EOF' int main(void) { return 0; } EOF % cat >bar <<'EOF' baz EOF Cheers, -- Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 24 09:32:26 2011 Received: (at submit) by debbugs.gnu.org; 24 Sep 2011 13:32:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R7SLA-0007KK-VA for submit@debbugs.gnu.org; Sat, 24 Sep 2011 09:32:26 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R7SL8-0007KD-O7 for submit@debbugs.gnu.org; Sat, 24 Sep 2011 09:32:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R7SKa-0004jR-2j for submit@debbugs.gnu.org; Sat, 24 Sep 2011 09:31:50 -0400 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 ([140.186.70.17]:34578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R7SKa-0004jM-0v for submit@debbugs.gnu.org; Sat, 24 Sep 2011 09:31:48 -0400 Received: from eggs.gnu.org ([140.186.70.92]:60060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R7SKX-0003lg-Hs for bug-automake@gnu.org; Sat, 24 Sep 2011 09:31:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R7SKU-0004io-H8 for bug-automake@gnu.org; Sat, 24 Sep 2011 09:31:45 -0400 Received: from mail-ww0-f41.google.com ([74.125.82.41]:49050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R7SKU-0004ig-4b; Sat, 24 Sep 2011 09:31:42 -0400 Received: by wwf10 with SMTP id 10so8923102wwf.0 for ; Sat, 24 Sep 2011 06:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:message-id; bh=u3CeWZ3mDgf5EuhFzZUHHV2M/w6biCoKNVcJqE/Aj9Q=; b=lzPAlpmA3UZEecVLeRO/x1TlLsUDrYL98xWgKW73/3ESDoQpUBl+jBLRGwk4Qc9sE3 Js0280rlMKsISsiImKHy3h8XYdwKqDmSF2qsp10G/+SN5FD1jKe9LMxhmG5kyP1cHFSo 4AvVDmaly3wWbkWYH1mhX0O18ZSAYOMQ//Cw8= Received: by 10.227.6.215 with SMTP id a23mr3364871wba.44.1316871101053; Sat, 24 Sep 2011 06:31:41 -0700 (PDT) Received: from bigio.localnet (host67-96-dynamic.4-87-r.retail.telecomitalia.it. [87.4.96.67]) by mx.google.com with ESMTPS id s34sm21256220wbo.0.2011.09.24.06.31.37 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 24 Sep 2011 06:31:39 -0700 (PDT) From: Stefano Lattarini To: bug-automake@gnu.org Subject: Re: bug#9578: make uninstall fails after make install-data in empty prefix. Date: Sat, 24 Sep 2011 15:31:22 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) References: <20110922184259.GA8608@elliptictech.com> In-Reply-To: <20110922184259.GA8608@elliptictech.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_rudfOp3JA9SCiNd" Message-Id: <201109241531.23699.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, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: submit Cc: 9578@debbugs.gnu.org, Nick Bowler , automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) --Boundary-00=_rudfOp3JA9SCiNd Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thursday 22 September 2011, Nick Bowler wrote: > Hello, > Hi Nick, thanks for the report. > I noticed a problem testing the uninstall target of my > automake-generated Makefiles. If the install prefix does not exist > before installation, automake will create the necessary directories. > But if you run a plain "make install-data" (without make install-exec), > the directories for executables are (unsurprisingly) not created. The > problem is that "make uninstall" fails in this case: > I'm not yet sure whether this should be considered a bug or a feature... I'm inclined to agree with you that it's more of a bug though, so I'll push the attached patch to maint in a few days if nobody objects. This change is not completely obvious, so any review would be appreciated. Notice that the test coverage added by the patch is far from perfect, but I'd rather improve it in the `testsuite-work' branch only, so that I'll be able to use TAP and won't be forced to write 10 or so new "sister tests" instead. Thanks, Stefano --Boundary-00=_rudfOp3JA9SCiNd Content-Type: text/x-patch; charset="utf-8"; name="0001-uninstall-make-uninstall-before-make-install-works.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="0001-uninstall-make-uninstall-before-make-install-works.patch" =46rom 21011463ca951d397be0ea89e58b278ca8f40c2f Mon Sep 17 00:00:00 2001 Message-Id: <21011463ca951d397be0ea89e58b278ca8f40c2f.1316870869.git.stefan= o.lattarini@gmail.com> =46rom: Stefano Lattarini Date: Fri, 23 Sep 2011 22:50:14 +0200 Subject: [PATCH] uninstall: "make uninstall" before "make install" works This change fixes automake bug#9578. * lib/am/inst-vars.am (am__uninstall_files_from_dir): New internal macro, that defines a shell code fragment to uninstall files from a given directory. * lib/am/data.am (uninstall-%DIR%%PRIMARY%): Use it, to reduce code duplication and improve consistency and correctness. * lib/am/libs.am (uninstall-%DIR%LIBRARIES): Likewise. * lib/am/lisp.am (uninstall-%DIR%LISP): Likewise. * lib/am/mans.am (uninstall-man%SECTION%): Likewise. * lib/am/python.am (uninstall-%DIR%LIBRARIES): Likewise. * lib/am/scripts.am (uninstall-%DIR%SCRIPTS): Likewise. * tests/uninstall-pr9578.test: New test. * tests/uninstall-fail.test: New test. * tests/Makefile.am (TESTS): Add them. * NEWS, THANKS: Update. Report by Nick Bowler. =2D-- ChangeLog | 20 ++++++++++++ Makefile.in | 10 ++++-- NEWS | 4 ++ THANKS | 1 + doc/Makefile.in | 14 +++++---- lib/Automake/Makefile.in | 14 +++++---- lib/Automake/tests/Makefile.in | 6 ++++ lib/Makefile.in | 14 +++++---- lib/am/Makefile.in | 10 ++++-- lib/am/data.am | 4 +-- lib/am/inst-vars.am | 18 +++++++++++ lib/am/libs.am | 4 +-- lib/am/lisp.am | 8 +---- lib/am/mans.am | 8 +---- lib/am/python.am | 15 ++++----- lib/am/scripts.am | 4 +-- m4/Makefile.in | 14 +++++---- tests/Makefile.am | 2 + tests/Makefile.in | 8 +++++ tests/uninstall-fail.test | 64 ++++++++++++++++++++++++++++++++++++= +++ tests/uninstall-pr9578.test | 65 ++++++++++++++++++++++++++++++++++++= ++++ 21 files changed, 248 insertions(+), 59 deletions(-) create mode 100755 tests/uninstall-fail.test create mode 100755 tests/uninstall-pr9578.test diff --git a/ChangeLog b/ChangeLog index 47aee92..4347a89 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2011-09-24 Stefano Lattarini + + uninstall: "make uninstall" before "make install" works + This change fixes automake bug#9578. + * lib/am/inst-vars.am (am__uninstall_files_from_dir): New internal + macro, that defines a shell code fragment to uninstall files from + a given directory. + * lib/am/data.am (uninstall-%DIR%%PRIMARY%): Use it, to reduce code + duplication and improve consistency and correctness. + * lib/am/libs.am (uninstall-%DIR%LIBRARIES): Likewise. + * lib/am/lisp.am (uninstall-%DIR%LISP): Likewise. + * lib/am/mans.am (uninstall-man%SECTION%): Likewise. + * lib/am/python.am (uninstall-%DIR%LIBRARIES): Likewise. + * lib/am/scripts.am (uninstall-%DIR%SCRIPTS): Likewise. + * tests/uninstall-pr9578.test: New test. + * tests/uninstall-fail.test: New test. + * tests/Makefile.am (TESTS): Add them. + * NEWS, THANKS: Update. + Report by Nick Bowler. + 2011-09-22 Stefano Lattarini =20 tests: fix tests on aclocal search path precedences diff --git a/Makefile.in b/Makefile.in index 35a9cbd..a8c3244 100644 =2D-- a/Makefile.in +++ b/Makefile.in @@ -91,6 +91,12 @@ am__nobase_list =3D $(am__nobase_strip_setup); \ am__base_list =3D \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir =3D { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + cd "$$dir" && rm -f $$files; }; \ + } am__installdirs =3D "$(DESTDIR)$(bindir)" SCRIPTS =3D $(bin_SCRIPTS) SOURCES =3D @@ -447,9 +453,7 @@ uninstall-binSCRIPTS: @list=3D'$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=3D`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ =2D test -n "$$list" || exit 0; \ =2D echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(bindir)" && rm -f $$files + dir=3D'$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) =20 # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. diff --git a/NEWS b/NEWS index b696977..54838d0 100644 =2D-- a/NEWS +++ b/NEWS @@ -61,6 +61,10 @@ Bugs fixed in 1.11.0a: =20 * Long standing bugs: =20 + - A "make uninstall" issued before a "make install", or after a mere + "make install-data" or a mere "make install-exec" does not spuriously + fail anymore. + - Automake now warns about more primary/directory invalid combinations, such as "doc_LIBRARIES" or "pkglib_PROGRAMS". =20 diff --git a/THANKS b/THANKS index f83e1fc..b840088 100644 =2D-- a/THANKS +++ b/THANKS @@ -244,6 +244,7 @@ Motoyuki Kasahara m-kasahr@sra.co.jp Nathanael Nerode neroden@twcny.rr.com Nelson H. F. Beebe beebe@math.utah.edu Nicholas Wourms nwourms@netscape.net +Nick Bowler nbowler@elliptictech.com Nicolas Joly njoly@pasteur.fr Nicolas Thiery nthiery@Icare.mines.edu NightStrike nightstrike@gmail.com diff --git a/doc/Makefile.in b/doc/Makefile.in index 3034dcb..23630ab 100644 =2D-- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -105,6 +105,12 @@ am__nobase_list =3D $(am__nobase_strip_setup); \ am__base_list =3D \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir =3D { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + cd "$$dir" && rm -f $$files; }; \ + } man1dir =3D $(mandir)/man1 NROFF =3D nroff MANS =3D $(dist_man1_MANS) @@ -478,9 +484,7 @@ uninstall-man1: files=3D`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ =2D test -z "$$files" || { \ =2D echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } + dir=3D'$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" @@ -498,9 +502,7 @@ uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list=3D'$(dist_doc_DATA)'; test -n "$(docdir)" || list=3D; \ files=3D`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ =2D test -n "$$files" || exit 0; \ =2D echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(docdir)" && rm -f $$files + dir=3D'$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) =20 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list=3D'$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index baccf7d..e23e0ae 100644 =2D-- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -96,6 +96,12 @@ am__nobase_list =3D $(am__nobase_strip_setup); \ am__base_list =3D \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir =3D { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + cd "$$dir" && rm -f $$files; }; \ + } am__installdirs =3D "$(DESTDIR)$(perllibdir)" "$(DESTDIR)$(perllibdir)" DATA =3D $(dist_perllib_DATA) $(nodist_perllib_DATA) RECURSIVE_CLEAN_TARGETS =3D mostlyclean-recursive clean-recursive \ @@ -316,9 +322,7 @@ uninstall-dist_perllibDATA: @$(NORMAL_UNINSTALL) @list=3D'$(dist_perllib_DATA)'; test -n "$(perllibdir)" || list=3D; \ files=3D`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ =2D test -n "$$files" || exit 0; \ =2D echo " ( cd '$(DESTDIR)$(perllibdir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(perllibdir)" && rm -f $$files + dir=3D'$(DESTDIR)$(perllibdir)'; $(am__uninstall_files_from_dir) install-nodist_perllibDATA: $(nodist_perllib_DATA) @$(NORMAL_INSTALL) test -z "$(perllibdir)" || $(MKDIR_P) "$(DESTDIR)$(perllibdir)" @@ -336,9 +340,7 @@ uninstall-nodist_perllibDATA: @$(NORMAL_UNINSTALL) @list=3D'$(nodist_perllib_DATA)'; test -n "$(perllibdir)" || list=3D; \ files=3D`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ =2D test -n "$$files" || exit 0; \ =2D echo " ( cd '$(DESTDIR)$(perllibdir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(perllibdir)" && rm -f $$files + dir=3D'$(DESTDIR)$(perllibdir)'; $(am__uninstall_files_from_dir) =20 # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 17a2002..14a8122 100644 =2D-- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -101,6 +101,12 @@ am__nobase_list =3D $(am__nobase_strip_setup); \ am__base_list =3D \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir =3D { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + cd "$$dir" && rm -f $$files; }; \ + } # Restructured Text title and section. am__rst_title =3D sed 's/.*/ & /;h;s/./=3D/g;p;x;p;g;p;s/.*//' am__rst_section =3D sed 'p;s/./=3D/g;p;g' diff --git a/lib/Makefile.in b/lib/Makefile.in index bc2a6c0..9caa64a 100644 =2D-- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -98,6 +98,12 @@ am__nobase_list =3D $(am__nobase_strip_setup); \ am__base_list =3D \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir =3D { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + cd "$$dir" && rm -f $$files; }; \ + } am__installdirs =3D "$(DESTDIR)$(pkgvdatadir)" "$(DESTDIR)$(scriptdir)" DATA =3D $(dist_pkgvdata_DATA) $(dist_script_DATA) RECURSIVE_CLEAN_TARGETS =3D mostlyclean-recursive clean-recursive \ @@ -287,9 +293,7 @@ uninstall-dist_pkgvdataDATA: @$(NORMAL_UNINSTALL) @list=3D'$(dist_pkgvdata_DATA)'; test -n "$(pkgvdatadir)" || list=3D; \ files=3D`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ =2D test -n "$$files" || exit 0; \ =2D echo " ( cd '$(DESTDIR)$(pkgvdatadir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(pkgvdatadir)" && rm -f $$files + dir=3D'$(DESTDIR)$(pkgvdatadir)'; $(am__uninstall_files_from_dir) install-dist_scriptDATA: $(dist_script_DATA) @$(NORMAL_INSTALL) test -z "$(scriptdir)" || $(MKDIR_P) "$(DESTDIR)$(scriptdir)" @@ -307,9 +311,7 @@ uninstall-dist_scriptDATA: @$(NORMAL_UNINSTALL) @list=3D'$(dist_script_DATA)'; test -n "$(scriptdir)" || list=3D; \ files=3D`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ =2D test -n "$$files" || exit 0; \ =2D echo " ( cd '$(DESTDIR)$(scriptdir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(scriptdir)" && rm -f $$files + dir=3D'$(DESTDIR)$(scriptdir)'; $(am__uninstall_files_from_dir) =20 # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index 649c1bf..194f1cb 100644 =2D-- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -89,6 +89,12 @@ am__nobase_list =3D $(am__nobase_strip_setup); \ am__base_list =3D \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir =3D { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + cd "$$dir" && rm -f $$files; }; \ + } am__installdirs =3D "$(DESTDIR)$(amdir)" DATA =3D $(dist_am_DATA) DISTFILES =3D $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -279,9 +285,7 @@ uninstall-dist_amDATA: @$(NORMAL_UNINSTALL) @list=3D'$(dist_am_DATA)'; test -n "$(amdir)" || list=3D; \ files=3D`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ =2D test -n "$$files" || exit 0; \ =2D echo " ( cd '$(DESTDIR)$(amdir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(amdir)" && rm -f $$files + dir=3D'$(DESTDIR)$(amdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: =20 diff --git a/lib/am/data.am b/lib/am/data.am index 36af717..1817447 100644 =2D-- a/lib/am/data.am +++ b/lib/am/data.am @@ -73,9 +73,7 @@ uninstall-%DIR%%PRIMARY%: @list=3D'$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=3D; \ ?BASE? files=3D`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ ?!BASE? $(am__nobase_strip_setup); files=3D`$(am__nobase_strip)`; \ =2D test -n "$$files" || exit 0; \ =2D echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files + dir=3D'$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir) endif %?INSTALL% =20 =20 diff --git a/lib/am/inst-vars.am b/lib/am/inst-vars.am index a49cfe9..477513f 100644 =2D-- a/lib/am/inst-vars.am +++ b/lib/am/inst-vars.am @@ -15,6 +15,7 @@ ## along with this program. If not, see . =20 if %?FIRST% + ## These variables help stripping any $(VPATH) that some ## Make implementations prepend before VPATH-found files. ## The issue is discussed at length in distdir.am. @@ -52,4 +53,21 @@ am__nobase_list =3D $(am__nobase_strip_setup); \ am__base_list =3D \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' + +## A shell code fragment to uninstall files from a given directory. +## It expects the $dir and $files shell variables to be defined respective= ly +## to the directory where the files to be removed are, and to the list of +## such files. +am__uninstall_files_from_dir =3D { \ +## Some rm implementations complain if `rm -f' is used without arguments. + test -z "$$files" \ +## At least Solaris /bin/sh still lacks `test -e', so we use the multiple +## tests below instead. We expect $dir to be either non-existent or a +## directory, so the failure we'll experience if it is a regular file +## is indeed desired and welcome (better to fail loudly thasn silently). + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + cd "$$dir" && rm -f $$files; }; \ + } + endif %?FIRST% diff --git a/lib/am/libs.am b/lib/am/libs.am index eec62a1..29f630b 100644 =2D-- a/lib/am/libs.am +++ b/lib/am/libs.am @@ -87,9 +87,7 @@ uninstall-%DIR%LIBRARIES: @list=3D'$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=3D; \ ?BASE? files=3D`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ ?!BASE? $(am__nobase_strip_setup); files=3D`$(am__nobase_strip)`; \ =2D test -n "$$files" || exit 0; \ =2D echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f "$$files" )"; \ =2D cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files + dir=3D'$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir) endif %?INSTALL% =20 =20 diff --git a/lib/am/lisp.am b/lib/am/lisp.am index ab45b30..6ffcdbf 100644 =2D-- a/lib/am/lisp.am +++ b/lib/am/lisp.am @@ -128,12 +128,8 @@ uninstall-%DIR%LISP: list=3D'$(%DIR%_LISP)'; \ ?BASE? files=3D`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ ?!BASE? $(am__nobase_strip_setup); files=3D`$(am__nobase_strip)`; \ =2D test -n "$$files" || exit 0; \ =2D filesc=3D`echo "$$files" | sed 's|$$|c|'`; \ =2D echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files || exit $$?; \ =2D echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$filesc ")"; \ =2D cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$filesc + files=3D"$$files "`echo "$$files" | sed 's|$$|c|'`; \ + dir=3D'$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir) endif %?INSTALL% =20 =20 diff --git a/lib/am/mans.am b/lib/am/mans.am index 66a6c7e..b41a94d 100644 =2D-- a/lib/am/mans.am +++ b/lib/am/mans.am @@ -119,9 +119,7 @@ if %?NOTRANS_MANS% ?HAVE_NOTRANS? sed -n '/\.%SECTION%[a-z]*$$/p'; \ ## Extract basename of manpage, change the extension if needed. } | sed 's,.*/,,;s,\.[^%SECTION%][0-9a-z]*$$,.%SECTION%,'`; \ =2D test -z "$$files" || { \ =2D echo " ( cd '$(DESTDIR)$(man%SECTION%dir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(man%SECTION%dir)" && rm -f $$files; } + dir=3D'$(DESTDIR)$(man%SECTION%dir)'; $(am__uninstall_files_from_dir) endif %?NOTRANS_MANS% if %?TRANS_MANS% ## Handle MANS without notrans_ prefix @@ -136,7 +134,5 @@ if %?TRANS_MANS% ## transform, and change the extension if needed. } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^%SECTION%][0-9a-z]*$$,%SECTION%,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ =2D test -z "$$files" || { \ =2D echo " ( cd '$(DESTDIR)$(man%SECTION%dir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(man%SECTION%dir)" && rm -f $$files; } + dir=3D'$(DESTDIR)$(man%SECTION%dir)'; $(am__uninstall_files_from_dir) endif %?TRANS_MANS% diff --git a/lib/am/python.am b/lib/am/python.am index 40aaa62..427c95d 100644 =2D-- a/lib/am/python.am +++ b/lib/am/python.am @@ -94,16 +94,15 @@ uninstall-%DIR%PYTHON: ?BASE? files=3D`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ ?!BASE? $(am__nobase_strip_setup); files=3D`$(am__nobase_strip)`; \ test -n "$$files" || exit 0; \ + dir=3D'$(DESTDIR)$(%NDIR%dir)'; \ +## Also remove the .pyc and .pyo byte compiled versions. filesc=3D`echo "$$files" | sed 's|$$|c|'`; \ fileso=3D`echo "$$files" | sed 's|$$|o|'`; \ =2D echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files || exit $$?; \ =2D## This is to remove the .pyc and .pyo byte compiled versions (a bit =2D## of a hack). =2D echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$filesc ")"; \ =2D cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$filesc || exit $$?; \ =2D echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$fileso ")"; \ =2D cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$fileso + st=3D0; \ + for files in "$$files" "$$filesc" "$$fileso"; do \ + $(am__uninstall_files_from_dir) || st=3D$$?; \ + done; \ + exit $$st endif %?INSTALL% =20 =20 diff --git a/lib/am/scripts.am b/lib/am/scripts.am index 790cb64..346f0d3 100644 =2D-- a/lib/am/scripts.am +++ b/lib/am/scripts.am @@ -83,9 +83,7 @@ uninstall-%DIR%SCRIPTS: ?!BASE? $(am__nobase_strip_setup); \ ?!BASE? files=3D`$(am__nobase_strip) \ ?!BASE? -e 'h;s,.*/,,;$(transform);x;s|[^/]*$$||;G;s,\n,,'`; \ =2D test -n "$$list" || exit 0; \ =2D echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files + dir=3D'$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir) endif %?INSTALL% =20 =20 diff --git a/m4/Makefile.in b/m4/Makefile.in index 2e7e547..9fb6989 100644 =2D-- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -89,6 +89,12 @@ am__nobase_list =3D $(am__nobase_strip_setup); \ am__base_list =3D \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir =3D { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + cd "$$dir" && rm -f $$files; }; \ + } am__installdirs =3D "$(DESTDIR)$(automake_acdir)" \ "$(DESTDIR)$(system_acdir)" DATA =3D $(dist_automake_ac_DATA) $(dist_system_ac_DATA) @@ -281,9 +287,7 @@ uninstall-dist_automake_acDATA: @$(NORMAL_UNINSTALL) @list=3D'$(dist_automake_ac_DATA)'; test -n "$(automake_acdir)" || list= =3D; \ files=3D`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ =2D test -n "$$files" || exit 0; \ =2D echo " ( cd '$(DESTDIR)$(automake_acdir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(automake_acdir)" && rm -f $$files + dir=3D'$(DESTDIR)$(automake_acdir)'; $(am__uninstall_files_from_dir) install-dist_system_acDATA: $(dist_system_ac_DATA) @$(NORMAL_INSTALL) test -z "$(system_acdir)" || $(MKDIR_P) "$(DESTDIR)$(system_acdir)" @@ -301,9 +305,7 @@ uninstall-dist_system_acDATA: @$(NORMAL_UNINSTALL) @list=3D'$(dist_system_ac_DATA)'; test -n "$(system_acdir)" || list=3D; \ files=3D`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ =2D test -n "$$files" || exit 0; \ =2D echo " ( cd '$(DESTDIR)$(system_acdir)' && rm -f" $$files ")"; \ =2D cd "$(DESTDIR)$(system_acdir)" && rm -f $$files + dir=3D'$(DESTDIR)$(system_acdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: =20 diff --git a/tests/Makefile.am b/tests/Makefile.am index 1d258c9..221f08a 100644 =2D-- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -852,6 +852,8 @@ txinfo32.test \ txinfo33.test \ transform.test \ transform2.test \ +uninstall-pr9578.test \ +uninstall-fail.test \ unused.test \ upc.test \ upc2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 7e9bc20..591cfc6 100644 =2D-- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -104,6 +104,12 @@ am__nobase_list =3D $(am__nobase_strip_setup); \ am__base_list =3D \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir =3D { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + cd "$$dir" && rm -f $$files; }; \ + } # Restructured Text title and section. am__rst_title =3D sed 's/.*/ & /;h;s/./=3D/g;p;x;p;g;p;s/.*//' am__rst_section =3D sed 'p;s/./=3D/g;p;g' @@ -1130,6 +1136,8 @@ txinfo32.test \ txinfo33.test \ transform.test \ transform2.test \ +uninstall-pr9578.test \ +uninstall-fail.test \ unused.test \ upc.test \ upc2.test \ diff --git a/tests/uninstall-fail.test b/tests/uninstall-fail.test new file mode 100755 index 0000000..6ba0eba =2D-- /dev/null +++ b/tests/uninstall-fail.test @@ -0,0 +1,64 @@ +#! /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 . + +# "make uninstall" complains and errors out on failures. + +# FIXME: this test only dealt with DATA primary; maybe we need sister +# tests for other primaries too? E.g., SCRIPTS, PROGRAMS, LISP, PYTHON, +# etc... + +. ./defs || Exit 1 + +set -e + +cat >> configure.in << 'END' +AC_OUTPUT +END + +cat > Makefile.am << 'END' +data_DATA =3D foobar.txt +END + +: > foobar.txt + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +inst=3D__inst-dir__ + +./configure --prefix=3D"`pwd`/$inst" + +mkdir $inst $inst/share +: > $inst/share/foobar.txt + +chmod a-w $inst/share +touch $inst/share/t && skip_ "cannot make directories unwritable" +rm -f $inst/share/t + +$MAKE uninstall >output 2>&1 && { cat output; Exit 1; } +cat output +grep "rm: .*foobar\.txt" output + +chmod a-rwx $inst/share +(cd $inst/share) && skip_ "cannot make directories fully unreadable" + +$MAKE uninstall >output 2>&1 && { cat output; Exit 1; } +cat output +grep "cd: .*$inst/share" output + + +: diff --git a/tests/uninstall-pr9578.test b/tests/uninstall-pr9578.test new file mode 100755 index 0000000..3f67203 =2D-- /dev/null +++ b/tests/uninstall-pr9578.test @@ -0,0 +1,65 @@ +#! /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 against automake bug#9578: "make uninstall" issued before +# "make install" or after a mere "make install-data" or a mere +# "make install-exec" failed spuriously. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in << 'END' +AC_OUTPUT +END + +: > foo +: > bar + +cat > Makefile.am << 'END' +bin_SCRIPTS =3D foo +data_DATA =3D bar +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +./configure --prefix=3D"`pwd`/inst" + +$MAKE uninstall +test ! -d inst + +rm -rf inst + +$MAKE install-exec +test -f inst/bin/foo || Exit 99 # Sanity check. +$MAKE uninstall +test ! -f inst/bin/foo + +$MAKE install-data +test -f inst/share/bar || Exit 99 # Sanity check. +$MAKE uninstall +test ! -f inst/share/bar + +rm -rf inst + +$MAKE install-exec +test -f inst/bin/foo || Exit 99 # Sanity check. +$MAKE uninstall +test ! -f inst/bin/foo + +: =2D-=20 1.7.2.3 --Boundary-00=_rudfOp3JA9SCiNd-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 24 10:15:49 2011 Received: (at control) by debbugs.gnu.org; 24 Sep 2011 14:15:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R7T1B-0008Rz-F6 for submit@debbugs.gnu.org; Sat, 24 Sep 2011 10:15:49 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R7T19-0008Rs-MU for control@debbugs.gnu.org; Sat, 24 Sep 2011 10:15:48 -0400 Received: by wyh21 with SMTP id 21so2347645wyh.3 for ; Sat, 24 Sep 2011 07:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; bh=V2qH/nJtQj/0pPNMP1Bshjm36EoSCdOK5pRZwskY/mk=; b=f3LuwaDafvub054SOvnDWiq7tvPG+q2emfcYR0vT0NyQyYGi0TpUWhVhp9v5RNhHFt GOdCV3qCcaxnC+EzjbcDu2ULkdTMv/IVn06FEYf1Z0YYMUs3/U6yhCg2hXVFlS4mfjmd NIMJbiAxYnFGZzRm9zqMrHb2pwgHoK6Ws5dEs= Received: by 10.227.24.136 with SMTP id v8mr3435877wbb.28.1316873714838; Sat, 24 Sep 2011 07:15:14 -0700 (PDT) Received: from bigio.localnet (host67-96-dynamic.4-87-r.retail.telecomitalia.it. [87.4.96.67]) by mx.google.com with ESMTPS id y10sm21385466wbm.14.2011.09.24.07.15.12 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 24 Sep 2011 07:15:13 -0700 (PDT) From: Stefano Lattarini To: control@debbugs.gnu.org Subject: tags Date: Sat, 24 Sep 2011 16:14:53 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201109241614.53472.stefano.lattarini@gmail.com> 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 9579 + patch tags 9578 + patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 26 15:56:34 2011 Received: (at submit) by debbugs.gnu.org; 26 Sep 2011 19:56:34 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R8HI2-0006l1-55 for submit@debbugs.gnu.org; Mon, 26 Sep 2011 15:56:34 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R8HHz-0006ku-Uo for submit@debbugs.gnu.org; Mon, 26 Sep 2011 15:56:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8HHF-0005Om-Ra for submit@debbugs.gnu.org; Mon, 26 Sep 2011 15:55:46 -0400 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 ([140.186.70.17]:57102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8HHF-0005Og-Pp for submit@debbugs.gnu.org; Mon, 26 Sep 2011 15:55:45 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8HHE-0000uE-Hn for bug-automake@gnu.org; Mon, 26 Sep 2011 15:55:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8HHD-0005OH-Fa for bug-automake@gnu.org; Mon, 26 Sep 2011 15:55:44 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:49902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8HHD-0005OC-BA; Mon, 26 Sep 2011 15:55:43 -0400 Received: by wyf22 with SMTP id 22so6501473wyf.0 for ; Mon, 26 Sep 2011 12:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=C3yR+z6dnxQuUIVpbYAvYNrwZPZ73lA8o9ZkDJCKAU8=; b=IKRZI45a7bELFZuLpUHW1rDAAohlAeBK26VgDQk1lVXEAnaWtRMc062qeTDMOCxiLV kTDuM1JR7NZXQUoDdvVQZPqwtH2a+Z5VecFRrtlab6b0QqGX7a5uqUe3w8FWUmI904hd pBJ3ir+e7hGOEmn7E/6M1SH6MptKI1bNNH3X8= Received: by 10.227.11.3 with SMTP id r3mr6167048wbr.43.1317066942429; Mon, 26 Sep 2011 12:55:42 -0700 (PDT) Received: from bigio.localnet (host135-37-dynamic.56-82-r.retail.telecomitalia.it. [82.56.37.135]) by mx.google.com with ESMTPS id fa3sm32545240wbb.3.2011.09.26.12.55.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Sep 2011 12:55:41 -0700 (PDT) From: Stefano Lattarini To: bug-automake@gnu.org Subject: Re: bug#9578: make uninstall fails after make install-data in empty prefix. Date: Mon, 26 Sep 2011 21:55:30 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) References: <20110922184259.GA8608@elliptictech.com> <201109241531.23699.stefano.lattarini@gmail.com> In-Reply-To: <201109241531.23699.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201109262155.31501.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, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Nick Bowler , 9578-done@debbugs.gnu.org, automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) On Saturday 24 September 2011, Stefano Lattarini wrote: > On Thursday 22 September 2011, Nick Bowler wrote: > > Hello, > > > Hi Nick, thanks for the report. > > > I noticed a problem testing the uninstall target of my > > automake-generated Makefiles. If the install prefix does not exist > > before installation, automake will create the necessary directories. > > But if you run a plain "make install-data" (without make install-exec), > > the directories for executables are (unsurprisingly) not created. The > > problem is that "make uninstall" fails in this case: > > > I'm not yet sure whether this should be considered a bug or a feature... > I'm inclined to agree with you that it's more of a bug though, so I'll > push the attached patch to maint in a few days if nobody objects. This > change is not completely obvious, so any review would be appreciated. > > Notice that the test coverage added by the patch is far from perfect, but > I'd rather improve it in the `testsuite-work' branch only, so that I'll > be able to use TAP and won't be forced to write 10 or so new "sister > tests" instead. > > Thanks, > Stefano > I've squashed in the following, and pushed. I'm thus closing the bug report. Regards, Stefano -*-*-*- diff --git a/tests/uninstall-fail.test b/tests/uninstall-fail.test index 6ba0eba..a3e7a7a 100755 --- a/tests/uninstall-fail.test +++ b/tests/uninstall-fail.test @@ -16,7 +16,7 @@ # "make uninstall" complains and errors out on failures. -# FIXME: this test only dealt with DATA primary; maybe we need sister +# FIXME: this test only deal with DATA primary; maybe we need sister # tests for other primaries too? E.g., SCRIPTS, PROGRAMS, LISP, PYTHON, # etc... diff --git a/tests/uninstall-pr9578.test b/tests/uninstall-pr9578.test index 3f67203..9aea52d 100755 --- a/tests/uninstall-pr9578.test +++ b/tests/uninstall-pr9578.test @@ -17,6 +17,10 @@ # Check against automake bug#9578: "make uninstall" issued before # "make install" or after a mere "make install-data" or a mere # "make install-exec" failed spuriously. +# +# FIXME: this test only deal with DATA and script primaries; maybe we +# need sister tests for other primaries too? E.g., PROGRAMS, LISP, +# PYTHON, etc... . ./defs || Exit 1 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 28 07:25:35 2011 Received: (at submit) by debbugs.gnu.org; 28 Sep 2011 11:25:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R8sGc-00078u-Ig for submit@debbugs.gnu.org; Wed, 28 Sep 2011 07:25:35 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R8sGT-00078g-RB for submit@debbugs.gnu.org; Wed, 28 Sep 2011 07:25:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8sFa-0000n6-Ea for submit@debbugs.gnu.org; Wed, 28 Sep 2011 07:24:31 -0400 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 ([140.186.70.17]:55028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8sFa-0000mv-Bj for submit@debbugs.gnu.org; Wed, 28 Sep 2011 07:24:30 -0400 Received: from eggs.gnu.org ([140.186.70.92]:36134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8sFZ-0006x3-56 for bug-automake@gnu.org; Wed, 28 Sep 2011 07:24:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8sFY-0000mY-1V for bug-automake@gnu.org; Wed, 28 Sep 2011 07:24:29 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:58299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8sFX-0000mH-Sh; Wed, 28 Sep 2011 07:24:28 -0400 Received: by wwp14 with SMTP id 14so6599153wwp.30 for ; Wed, 28 Sep 2011 04:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:message-id; bh=5XjNiYgN7FsSxK5I3QqkXilDlcW7JXZuDMLxBS4TsnY=; b=u8ck76KKl3FQPC3MeIK2SJ/5HtA7ddErNnDHnzQQY8yWrSpsOMa07MQZ4tWpSzLte1 CWXbz+hS3cnV+LzKb+EUbDJOZfigJilvWnPG6TMWGRmR0M2TYkQu8qWSnrwm7+yDa25D Bz/BrNpz8kpRfcv0annRJsHahpMFEzx2RgAV8= Received: by 10.216.88.140 with SMTP id a12mr9795032wef.82.1317209066765; Wed, 28 Sep 2011 04:24:26 -0700 (PDT) Received: from bigio.localnet (host203-50-dynamic.58-82-r.retail.telecomitalia.it. [82.58.50.203]) by mx.google.com with ESMTPS id es10sm34384027wbb.4.2011.09.28.04.24.24 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Sep 2011 04:24:25 -0700 (PDT) From: Stefano Lattarini To: bug-automake@gnu.org Subject: Re: bug#9578: make uninstall fails after make install-data in empty prefix. Date: Wed, 28 Sep 2011 13:24:13 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) References: <20110922184259.GA8608@elliptictech.com> <201109241531.23699.stefano.lattarini@gmail.com> <201109262155.31501.stefano.lattarini@gmail.com> In-Reply-To: <201109262155.31501.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_ePwgO3s1OAJPzd4" Message-Id: <201109281324.14501.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, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: submit Cc: 9578@debbugs.gnu.org, Nick Bowler , automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) --Boundary-00=_ePwgO3s1OAJPzd4 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Monday 26 September 2011, Stefano Lattarini wrote: > On Saturday 24 September 2011, Stefano Lattarini wrote: > > On Thursday 22 September 2011, Nick Bowler wrote: > > > Hello, > > > > > Hi Nick, thanks for the report. > > > > > I noticed a problem testing the uninstall target of my > > > automake-generated Makefiles. If the install prefix does not exist > > > before installation, automake will create the necessary directories. > > > But if you run a plain "make install-data" (without make install-exec), > > > the directories for executables are (unsurprisingly) not created. The > > > problem is that "make uninstall" fails in this case: > > > > > I'm not yet sure whether this should be considered a bug or a feature... > > I'm inclined to agree with you that it's more of a bug though, so I'll > > push the attached patch to maint in a few days if nobody objects. This > > change is not completely obvious, so any review would be appreciated. > > > > Notice that the test coverage added by the patch is far from perfect, but > > I'd rather improve it in the `testsuite-work' branch only, so that I'll > > be able to use TAP and won't be forced to write 10 or so new "sister > > tests" instead. > > > > Thanks, > > Stefano > > > Oops, the patch as I've pushed it was causing "make maintainer-check" to fail. I've pushed the attached follow-up to fix this. Sorry for the noise, Stefano --Boundary-00=_ePwgO3s1OAJPzd4 Content-Type: text/x-patch; charset="utf-8"; name="0001-maintcheck-fix-usage-of-cd-instead-of-am__cd.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="0001-maintcheck-fix-usage-of-cd-instead-of-am__cd.patch" =46rom a2803e6a0d65e5124dd12d89acab61ac8fc11a53 Mon Sep 17 00:00:00 2001 Message-Id: =46rom: Stefano Lattarini Date: Wed, 28 Sep 2011 13:17:13 +0200 Subject: [PATCH] maintcheck: fix usage of `cd' instead of `$(am__cd)' * lib/am/inst-vars.am (am__uninstall_files_from_dir): Use `$(am__cd)', not plain `cd'. =2D-- ChangeLog | 6 ++++++ lib/am/inst-vars.am | 2 +- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4347a89..c3b041d 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-09-28 Stefano Lattarini + + maintcheck: fix usage of `cd' instead of `$(am__cd)' + * lib/am/inst-vars.am (am__uninstall_files_from_dir): Use + `$(am__cd)', not plain `cd'. + 2011-09-24 Stefano Lattarini =20 uninstall: "make uninstall" before "make install" works diff --git a/lib/am/inst-vars.am b/lib/am/inst-vars.am index 477513f..a807f79 100644 =2D-- a/lib/am/inst-vars.am +++ b/lib/am/inst-vars.am @@ -67,7 +67,7 @@ am__uninstall_files_from_dir =3D { \ ## is indeed desired and welcome (better to fail loudly thasn silently). || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ =2D cd "$$dir" && rm -f $$files; }; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ } =20 endif %?FIRST% =2D-=20 1.7.2.3 --Boundary-00=_ePwgO3s1OAJPzd4-- From unknown Sun Jun 22 03:57:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 27 Oct 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator