summaryrefslogtreecommitdiff
path: root/lib/am/python.am
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2011-09-23 22:50:14 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2011-09-26 21:46:59 +0200
commiteae5cfa9b373ee19b2768957b53dbe53a586b69e (patch)
tree5e91f6e72b5f6785f631fa2996c156f4761abc65 /lib/am/python.am
parentb9fa1fc1eb50d7907764ec0972a674548a7bd8b3 (diff)
downloadautomake-eae5cfa9b373ee19b2768957b53dbe53a586b69e.tar.gz
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.
Diffstat (limited to 'lib/am/python.am')
-rw-r--r--lib/am/python.am15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/am/python.am b/lib/am/python.am
index 40aaa620d..427c95d0c 100644
--- a/lib/am/python.am
+++ b/lib/am/python.am
@@ -94,16 +94,15 @@ uninstall-%DIR%PYTHON:
?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
test -n "$$files" || exit 0; \
+ dir='$(DESTDIR)$(%NDIR%dir)'; \
+## Also remove the .pyc and .pyo byte compiled versions.
filesc=`echo "$$files" | sed 's|$$|c|'`; \
fileso=`echo "$$files" | sed 's|$$|o|'`; \
- echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files || exit $$?; \
-## This is to remove the .pyc and .pyo byte compiled versions (a bit
-## of a hack).
- echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$filesc ")"; \
- cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$filesc || exit $$?; \
- echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$fileso ")"; \
- cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$fileso
+ st=0; \
+ for files in "$$files" "$$filesc" "$$fileso"; do \
+ $(am__uninstall_files_from_dir) || st=$$?; \
+ done; \
+ exit $$st
endif %?INSTALL%