summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-03-07 21:26:49 +0000
committerZac Medico <zmedico@gentoo.org>2008-03-07 21:26:49 +0000
commit6131dfaf0c8965478dd1d993b6dd3b2c0623493d (patch)
tree5cb2153f0fac8093f8572211b22d07096bdbef4d
parent604fcc64957a466b38ef451c54e7a0005e1cd4a8 (diff)
downloadportage-6131dfaf0c8965478dd1d993b6dd3b2c0623493d.tar.gz
portage-6131dfaf0c8965478dd1d993b6dd3b2c0623493d.tar.bz2
portage-6131dfaf0c8965478dd1d993b6dd3b2c0623493d.zip
Make --prune and --depclean operate with missing dependencies when only
asked to remove specific packages since it's relatively safe in this case. svn path=/main/trunk/; revision=9451
-rw-r--r--pym/_emerge/__init__.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 01c55dbae..2822895bb 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -6326,6 +6326,14 @@ def action_depclean(settings, trees, ldpath_mtimes,
# Kill packages that aren't explicitly merged or are required as a
# dependency of another package. World file is explicit.
+ # Global depclean or prune operations are not very safe when there are
+ # missing dependencies since it's unknown how badly incomplete
+ # the dependency graph is, and we might accidentally remove packages
+ # that should have been pulled into the graph. On the other hand, it's
+ # relatively safe to ignore missing deps when only asked to remove
+ # specific packages.
+ allow_missing_deps = len(myfiles) > 0
+
msg = []
msg.append("Depclean may break link level dependencies. Thus, it is\n")
msg.append("recommended to use a tool such as " + good("`revdep-rebuild`") + " (from\n")
@@ -6540,13 +6548,13 @@ def action_depclean(settings, trees, ldpath_mtimes,
if "--quiet" not in myopts:
print "\b\b... done!\n"
- if unresolveable:
+ if unresolveable and not allow_missing_deps:
print "Dependencies could not be completely resolved due to"
print "the following required packages not being installed:"
print
for atom in unresolveable:
print atom, "required by", " ".join(unresolveable[atom])
- if unresolveable:
+ if unresolveable and not allow_missing_deps:
print
print "Have you forgotten to run " + good("`emerge --update --newuse --deep world`") + " prior to"
print "%s? It may be necessary to manually uninstall packages that no longer" % action