diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-04-19 06:34:13 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-04-19 06:34:13 +0000 |
commit | 9be52e23a5650c5003dedba3bec9b8a3c1f56db5 (patch) | |
tree | bed6c41d9ac5d03c2e23f171dd6f1e97844fbf93 | |
parent | 46c4b2c9e611cc381ed4fd9bcc4e16ec903b24a7 (diff) | |
download | portage-9be52e23a5650c5003dedba3bec9b8a3c1f56db5.tar.gz portage-9be52e23a5650c5003dedba3bec9b8a3c1f56db5.tar.bz2 portage-9be52e23a5650c5003dedba3bec9b8a3c1f56db5.zip |
In action_deselect(), use the installed packages to expand atoms into slot
atoms.
svn path=/main/trunk/; revision=13366
-rw-r--r-- | pym/_emerge/__init__.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 38ba17645..92f2dbae0 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -14060,11 +14060,23 @@ def action_uninstall(settings, trees, ldpath_mtimes, return rval def action_deselect(settings, trees, opts, atoms): - world_set = trees[settings['ROOT']]['root_config'].sets['world'] + root_config = trees[settings['ROOT']]['root_config'] + world_set = root_config.sets['world'] if not hasattr(world_set, 'update'): writemsg_level("World set does not appear to be mutable.\n", level=logging.ERROR, noiselevel=-1) return 1 + + vardb = root_config.trees['vartree'].dbapi + expanded_atoms = set(atoms) + from portage.dep import Atom + for atom in atoms: + for cpv in vardb.match(atom): + slot, = vardb.aux_get(cpv, ['SLOT']) + if not slot: + slot = '0' + expanded_atoms.add(Atom('%s:%s' % (portage.cpv_getkey(cpv), slot))) + pretend = '--pretend' in opts locked = False if not pretend and hasattr(world_set, 'lock'): @@ -14073,12 +14085,11 @@ def action_deselect(settings, trees, opts, atoms): try: discard_atoms = set() world_set.load() - from portage.dep import Atom for atom in world_set: if not isinstance(atom, Atom): # nested set continue - for arg_atom in atoms: + for arg_atom in expanded_atoms: if arg_atom.intersects(atom) and \ not (arg_atom.slot and not atom.slot): discard_atoms.add(atom) |