summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2011-09-28 11:11:51 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2011-09-28 11:11:51 +0200
commit58d91b7f376198d4a6553ba36f888fe47c2b6003 (patch)
tree508937fb4accebffb5c5d97c1a8b5bdb7e26e1b3 /lib
parent22e59ff1918b4165665d206a311f07dea264c83a (diff)
parentc4f363ff3d699eaa6b1e1cc079d33749957934c9 (diff)
downloadautomake-58d91b7f376198d4a6553ba36f888fe47c2b6003.tar.gz
Merge branch 'maint'
* maint: uninstall: "make uninstall" before "make install" works
Diffstat (limited to 'lib')
-rw-r--r--lib/Automake/Makefile.in14
-rw-r--r--lib/Automake/tests/Makefile.in6
-rw-r--r--lib/Makefile.in14
-rw-r--r--lib/am/Makefile.in10
-rw-r--r--lib/am/data.am4
-rw-r--r--lib/am/inst-vars.am18
-rw-r--r--lib/am/libs.am4
-rw-r--r--lib/am/lisp.am8
-rw-r--r--lib/am/mans.am8
-rw-r--r--lib/am/python.am15
-rw-r--r--lib/am/scripts.am4
11 files changed, 61 insertions, 44 deletions
diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in
index 8719084de..89d27639f 100644
--- a/lib/Automake/Makefile.in
+++ b/lib/Automake/Makefile.in
@@ -102,6 +102,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)$(perllibdir)" "$(DESTDIR)$(perllibdir)"
DATA = $(dist_perllib_DATA) $(nodist_perllib_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
@@ -323,9 +329,7 @@ uninstall-dist_perllibDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_perllib_DATA)'; test -n "$(perllibdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- test -n "$$files" || exit 0; \
- echo " ( cd '$(DESTDIR)$(perllibdir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(perllibdir)" && rm -f $$files
+ dir='$(DESTDIR)$(perllibdir)'; $(am__uninstall_files_from_dir)
install-nodist_perllibDATA: $(nodist_perllib_DATA)
@$(NORMAL_INSTALL)
test -z "$(perllibdir)" || $(MKDIR_P) "$(DESTDIR)$(perllibdir)"
@@ -343,9 +347,7 @@ uninstall-nodist_perllibDATA:
@$(NORMAL_UNINSTALL)
@list='$(nodist_perllib_DATA)'; test -n "$(perllibdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- test -n "$$files" || exit 0; \
- echo " ( cd '$(DESTDIR)$(perllibdir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(perllibdir)" && rm -f $$files
+ dir='$(DESTDIR)$(perllibdir)'; $(am__uninstall_files_from_dir)
# 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 967a95286..fd7b9afee 100644
--- a/lib/Automake/tests/Makefile.in
+++ b/lib/Automake/tests/Makefile.in
@@ -107,6 +107,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; }; \
+ }
# Restructured Text title and section.
am__rst_title = sed 's/.*/ & /;h;s/./=/g;p;x;p;g;p;s/.*//'
am__rst_section = sed 'p;s/./=/g;p;g'
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 54de12653..bd987596b 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -105,6 +105,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)$(pkgvdatadir)" "$(DESTDIR)$(scriptdir)"
DATA = $(dist_pkgvdata_DATA) $(dist_script_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
@@ -293,9 +299,7 @@ uninstall-dist_pkgvdataDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_pkgvdata_DATA)'; test -n "$(pkgvdatadir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- test -n "$$files" || exit 0; \
- echo " ( cd '$(DESTDIR)$(pkgvdatadir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(pkgvdatadir)" && rm -f $$files
+ dir='$(DESTDIR)$(pkgvdatadir)'; $(am__uninstall_files_from_dir)
install-dist_scriptDATA: $(dist_script_DATA)
@$(NORMAL_INSTALL)
test -z "$(scriptdir)" || $(MKDIR_P) "$(DESTDIR)$(scriptdir)"
@@ -313,9 +317,7 @@ uninstall-dist_scriptDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_script_DATA)'; test -n "$(scriptdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- test -n "$$files" || exit 0; \
- echo " ( cd '$(DESTDIR)$(scriptdir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(scriptdir)" && rm -f $$files
+ dir='$(DESTDIR)$(scriptdir)'; $(am__uninstall_files_from_dir)
# 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 f31c27f5e..098a3d415 100644
--- a/lib/am/Makefile.in
+++ b/lib/am/Makefile.in
@@ -95,6 +95,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)$(amdir)"
DATA = $(dist_am_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -285,9 +291,7 @@ uninstall-dist_amDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_am_DATA)'; test -n "$(amdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- test -n "$$files" || exit 0; \
- echo " ( cd '$(DESTDIR)$(amdir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(amdir)" && rm -f $$files
+ dir='$(DESTDIR)$(amdir)'; $(am__uninstall_files_from_dir)
tags: TAGS
TAGS:
diff --git a/lib/am/data.am b/lib/am/data.am
index 36af717f0..1817447de 100644
--- a/lib/am/data.am
+++ b/lib/am/data.am
@@ -73,9 +73,7 @@ uninstall-%DIR%%PRIMARY%:
@list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
?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; \
- echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files
+ dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
endif %?INSTALL%
diff --git a/lib/am/inst-vars.am b/lib/am/inst-vars.am
index a49cfe934..477513ff8 100644
--- a/lib/am/inst-vars.am
+++ b/lib/am/inst-vars.am
@@ -15,6 +15,7 @@
## along with this program. If not, see <http://www.gnu.org/licenses/>.
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 = $(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'
+
+## A shell code fragment to uninstall files from a given directory.
+## It expects the $dir and $files shell variables to be defined respectively
+## to the directory where the files to be removed are, and to the list of
+## such files.
+am__uninstall_files_from_dir = { \
+## 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 eec62a1f7..29f630b76 100644
--- a/lib/am/libs.am
+++ b/lib/am/libs.am
@@ -87,9 +87,7 @@ uninstall-%DIR%LIBRARIES:
@list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
?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; \
- echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f "$$files" )"; \
- cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files
+ dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
endif %?INSTALL%
diff --git a/lib/am/lisp.am b/lib/am/lisp.am
index ab45b30e6..6ffcdbfcc 100644
--- a/lib/am/lisp.am
+++ b/lib/am/lisp.am
@@ -128,12 +128,8 @@ uninstall-%DIR%LISP:
list='$(%DIR%_LISP)'; \
?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; \
- filesc=`echo "$$files" | sed 's|$$|c|'`; \
- echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files || exit $$?; \
- echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$filesc ")"; \
- cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$filesc
+ files="$$files "`echo "$$files" | sed 's|$$|c|'`; \
+ dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
endif %?INSTALL%
diff --git a/lib/am/mans.am b/lib/am/mans.am
index 66a6c7ee2..b41a94d18 100644
--- 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%,'`; \
- test -z "$$files" || { \
- echo " ( cd '$(DESTDIR)$(man%SECTION%dir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(man%SECTION%dir)" && rm -f $$files; }
+ dir='$(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,.,'`; \
- test -z "$$files" || { \
- echo " ( cd '$(DESTDIR)$(man%SECTION%dir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(man%SECTION%dir)" && rm -f $$files; }
+ dir='$(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 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%
diff --git a/lib/am/scripts.am b/lib/am/scripts.am
index 790cb649f..346f0d3b9 100644
--- a/lib/am/scripts.am
+++ b/lib/am/scripts.am
@@ -83,9 +83,7 @@ uninstall-%DIR%SCRIPTS:
?!BASE? $(am__nobase_strip_setup); \
?!BASE? files=`$(am__nobase_strip) \
?!BASE? -e 'h;s,.*/,,;$(transform);x;s|[^/]*$$||;G;s,\n,,'`; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files
+ dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
endif %?INSTALL%