summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-04 04:48:49 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-04 04:48:49 +0000
commit7c3ca3064aac2803368e81f576141968e7064bde (patch)
treea7b93d528957348c6e0fb511d016e756300744cd /pym
parentd07d0ada49e0c42ec3cc0cf2e2eb3b830d9c1f49 (diff)
downloadportage-7c3ca3064aac2803368e81f576141968e7064bde.tar.gz
portage-7c3ca3064aac2803368e81f576141968e7064bde.tar.bz2
portage-7c3ca3064aac2803368e81f576141968e7064bde.zip
When the user has given --depclean a list of atoms to clean, pull all
installed packages into the graph (not just those traversable from system or world) to ensure that packages can not be uninstalled unless nothing requires them. svn path=/main/trunk/; revision=9699
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/__init__.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 531a08d0f..ead6766ab 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -6548,12 +6548,18 @@ def action_depclean(settings, trees, ldpath_mtimes,
remaining_atoms = []
if action == "depclean":
- for atom in worldlist:
- if vardb.match(atom):
- remaining_atoms.append((atom, 'world', runtime))
for atom in syslist:
if vardb.match(atom):
remaining_atoms.append((atom, 'system', runtime))
+ if myfiles:
+ # Pull in everything that's installed since we don't want
+ # to clean any package if something depends on it.
+ remaining_atoms.extend(
+ ("="+atom, 'world', runtime) for cpv in vardb.cpv_all())
+ else:
+ for atom in worldlist:
+ if vardb.match(atom):
+ remaining_atoms.append((atom, 'world', runtime))
elif action == "prune":
for atom in syslist:
if vardb.match(atom):