1 |
Author: zmedico |
2 |
Date: 2009-04-30 07:19:43 +0000 (Thu, 30 Apr 2009) |
3 |
New Revision: 13522 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.6/pym/_emerge/__init__.py |
7 |
Log: |
8 |
In action_deselect(), use the installed packages to expand atoms into slot |
9 |
atoms. (trunk r13366) |
10 |
|
11 |
Modified: main/branches/2.1.6/pym/_emerge/__init__.py |
12 |
=================================================================== |
13 |
--- main/branches/2.1.6/pym/_emerge/__init__.py 2009-04-30 07:19:32 UTC (rev 13521) |
14 |
+++ main/branches/2.1.6/pym/_emerge/__init__.py 2009-04-30 07:19:43 UTC (rev 13522) |
15 |
@@ -13884,11 +13884,23 @@ |
16 |
return rval |
17 |
|
18 |
def action_deselect(settings, trees, opts, atoms): |
19 |
- world_set = trees[settings['ROOT']]['root_config'].sets['world'] |
20 |
+ root_config = trees[settings['ROOT']]['root_config'] |
21 |
+ world_set = root_config.sets['world'] |
22 |
if not hasattr(world_set, 'update'): |
23 |
writemsg_level("World set does not appear to be mutable.\n", |
24 |
level=logging.ERROR, noiselevel=-1) |
25 |
return 1 |
26 |
+ |
27 |
+ vardb = root_config.trees['vartree'].dbapi |
28 |
+ expanded_atoms = set(atoms) |
29 |
+ from portage.dep import Atom |
30 |
+ for atom in atoms: |
31 |
+ for cpv in vardb.match(atom): |
32 |
+ slot, = vardb.aux_get(cpv, ['SLOT']) |
33 |
+ if not slot: |
34 |
+ slot = '0' |
35 |
+ expanded_atoms.add(Atom('%s:%s' % (portage.cpv_getkey(cpv), slot))) |
36 |
+ |
37 |
pretend = '--pretend' in opts |
38 |
locked = False |
39 |
if not pretend and hasattr(world_set, 'lock'): |
40 |
@@ -13897,12 +13909,11 @@ |
41 |
try: |
42 |
discard_atoms = set() |
43 |
world_set.load() |
44 |
- from portage.dep import Atom |
45 |
for atom in world_set: |
46 |
if not isinstance(atom, Atom): |
47 |
# nested set |
48 |
continue |
49 |
- for arg_atom in atoms: |
50 |
+ for arg_atom in expanded_atoms: |
51 |
if arg_atom.intersects(atom) and \ |
52 |
not (arg_atom.slot and not atom.slot): |
53 |
discard_atoms.add(atom) |