This is the mail archive of the mailing list for the Archer project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[python] [approval-request] Make uninstall-python safe


not committed and IMO not so important as I am unaware if anyone uses

datadir remains created although whole pythondir incl. its base gets deleted.

	* (uninstall-python): Remove only the specific files.
diff --git a/gdb/ b/gdb/
index 450c8a0..f32bb1d 100644
--- a/gdb/
+++ b/gdb/
@@ -1949,9 +1949,17 @@ install-python:
 	  $(INSTALL_DATA) $(srcdir)/python/lib/$$file $(DESTDIR)$(pythondir)/$$file; \
-# Brute force.
+# Other packages may have their files installed in $(pythondir).
-	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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]