From eae5cfa9b373ee19b2768957b53dbe53a586b69e Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 23 Sep 2011 22:50:14 +0200 Subject: 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. --- m4/Makefile.in | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'm4') diff --git a/m4/Makefile.in b/m4/Makefile.in index 2e7e5470d..9fb6989f0 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -89,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + 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 = "$(DESTDIR)$(automake_acdir)" \ "$(DESTDIR)$(system_acdir)" DATA = $(dist_automake_ac_DATA) $(dist_system_ac_DATA) @@ -281,9 +287,7 @@ uninstall-dist_automake_acDATA: @$(NORMAL_UNINSTALL) @list='$(dist_automake_ac_DATA)'; test -n "$(automake_acdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(automake_acdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(automake_acdir)" && rm -f $$files + dir='$(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='$(dist_system_ac_DATA)'; test -n "$(system_acdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(system_acdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(system_acdir)" && rm -f $$files + dir='$(DESTDIR)$(system_acdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: -- cgit v1.2.1