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