GNU bug report logs -
#9578
make uninstall fails after make install-data in empty prefix.
Previous Next
Reported by: Nick Bowler <nbowler <at> elliptictech.com>
Date: Thu, 22 Sep 2011 18:47:01 UTC
Severity: normal
Tags: patch
Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#9578: make uninstall fails after make install-data in empty prefix.
which was filed against the automake package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 9578 <at> debbugs.gnu.org.
--
9578: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9578
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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
[Message part 3 (message/rfc822, inline)]
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/)
This bug report was last modified 13 years and 241 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.