This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
[python] [approval-request] Make uninstall-python safe
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: archer at sourceware dot org
- Date: Wed, 4 Mar 2009 23:26:54 +0100
- Subject: [python] [approval-request] Make uninstall-python safe
Hi,
not committed and IMO not so important as I am unaware if anyone uses
`uninstall':
datadir remains created although whole pythondir incl. its base gets deleted.
gdb/
* Makefile.in (uninstall-python): Remove only the specific files.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 450c8a0..f32bb1d 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1949,9 +1949,17 @@ install-python:
$(INSTALL_DATA) $(srcdir)/python/lib/$$file $(DESTDIR)$(pythondir)/$$file; \
done
-# Brute force.
+# Other packages may have their files installed in $(pythondir).
uninstall-python:
- rm -rf $(DESTDIR)/$(pythondir)
+ files='$(PY_FILES)'; for file in $$files; do \
+ slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'`; \
+ rm -f $(DESTDIR)$(pythondir)/$$file; \
+ while test "x$$file" != "x$$slashdir"; do \
+ rmdir 2>/dev/null "$(DESTDIR)$(pythondir)$$slashdir"; \
+ file="$$slashdir"; \
+ slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'`; \
+ done \
+ done
#
# Dependency tracking. Most of this is conditional on GNU Make being