summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-04 04:52:21 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-04 04:52:21 +0000
commit3f0c9f2c954c23422a14d17a13684361c5128582 (patch)
tree8517dfdb72f27f25ab9461bc70ff8676a34f4ea7 /bin
parentd19d3720213f5f44f09db54fff0c5b45702ec61a (diff)
downloadportage-3f0c9f2c954c23422a14d17a13684361c5128582.tar.gz
portage-3f0c9f2c954c23422a14d17a13684361c5128582.tar.bz2
portage-3f0c9f2c954c23422a14d17a13684361c5128582.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. (trunk r9698:9700) svn path=/main/branches/2.1.2/; revision=9701
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emerge12
1 files changed, 9 insertions, 3 deletions
diff --git a/bin/emerge b/bin/emerge
index 6d698e744..d8247d0a3 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -6096,12 +6096,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(
+ ("="+cpv, '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):