1 |
Author: zmedico |
2 |
Date: 2008-05-31 20:02:58 +0000 (Sat, 31 May 2008) |
3 |
New Revision: 10521 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
Log: |
8 |
Fix create_world_atom() to take a Package instance in it's arguments. |
9 |
|
10 |
|
11 |
Modified: main/trunk/pym/_emerge/__init__.py |
12 |
=================================================================== |
13 |
--- main/trunk/pym/_emerge/__init__.py 2008-05-31 09:37:28 UTC (rev 10520) |
14 |
+++ main/trunk/pym/_emerge/__init__.py 2008-05-31 20:02:58 UTC (rev 10521) |
15 |
@@ -736,15 +736,14 @@ |
16 |
self.sets = self.setconfig.getSets() |
17 |
self.visible_pkgs = PackageVirtualDbapi(self.settings) |
18 |
|
19 |
-def create_world_atom(pkg_key, metadata, args_set, root_config): |
20 |
+def create_world_atom(pkg, args_set, root_config): |
21 |
"""Create a new atom for the world file if one does not exist. If the |
22 |
argument atom is precise enough to identify a specific slot then a slot |
23 |
atom will be returned. Atoms that are in the system set may also be stored |
24 |
in world since system atoms can only match one slot while world atoms can |
25 |
be greedy with respect to slots. Unslotted system packages will not be |
26 |
stored in world.""" |
27 |
- pkg = Package(cpv=pkg_key, root_config=root_config, metadata=metadata) |
28 |
- metadata = pkg.metadata |
29 |
+ |
30 |
arg_atom = args_set.findAtomForPackage(pkg) |
31 |
if not arg_atom: |
32 |
return None |
33 |
@@ -766,7 +765,7 @@ |
34 |
if slotted and arg_atom != cp: |
35 |
# If the user gave a specific atom, store it as a |
36 |
# slot atom in the world file. |
37 |
- slot_atom = "%s:%s" % (cp, metadata["SLOT"]) |
38 |
+ slot_atom = pkg.slot_atom |
39 |
|
40 |
# For USE=multislot, there are a couple of cases to |
41 |
# handle here: |
42 |
@@ -4928,8 +4927,7 @@ |
43 |
myroot == self.target_root and \ |
44 |
favorites_set.findAtomForPackage(pkg): |
45 |
# Maybe it will be added to world now. |
46 |
- if create_world_atom(pkg_key, metadata, |
47 |
- favorites_set, root_config): |
48 |
+ if create_world_atom(pkg, favorites_set, root_config): |
49 |
pkg_world = True |
50 |
except portage.exception.InvalidDependString: |
51 |
# This is reported elsewhere if relevant. |
52 |
@@ -5228,10 +5226,9 @@ |
53 |
pkg_type, root, pkg_key, pkg_status = x |
54 |
if pkg_status != "nomerge": |
55 |
continue |
56 |
- metadata = x.metadata |
57 |
+ |
58 |
try: |
59 |
- myfavkey = create_world_atom(pkg_key, metadata, |
60 |
- args_set, root_config) |
61 |
+ myfavkey = create_world_atom(pkg, args_set, root_config) |
62 |
if myfavkey: |
63 |
if myfavkey in added_favorites: |
64 |
continue |
65 |
@@ -6178,8 +6175,7 @@ |
66 |
args_set.findAtomForPackage(pkg): |
67 |
world_set.lock() |
68 |
world_set.load() # maybe it's changed on disk |
69 |
- myfavkey = create_world_atom(pkg_key, metadata, |
70 |
- args_set, root_config) |
71 |
+ myfavkey = create_world_atom(pkg, args_set, root_config) |
72 |
if myfavkey: |
73 |
print ">>> Recording",myfavkey,"in \"world\" favorites file..." |
74 |
emergelog(xterm_titles, " === ("+\ |
75 |
|
76 |
-- |
77 |
gentoo-commits@l.g.o mailing list |