summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/emerge/__init__.py26
1 files changed, 18 insertions, 8 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index 96e370fc1..f409f1ba0 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -686,7 +686,7 @@ class RootConfig(object):
system_set = SystemSet(self.settings)
self.sets["system"] = system_set
-def create_world_atom(pkg_key, metadata, args_set, sets, portdb):
+def create_world_atom(pkg_key, metadata, args_set, root_config):
"""Create a new atom for the world file if one does not exist. If the
argument atom is precise enough to identify a specific slot then a slot
atom will be returned. Atoms that are in the system set may also be stored
@@ -696,9 +696,19 @@ def create_world_atom(pkg_key, metadata, args_set, sets, portdb):
arg_atom = args_set.findAtomForPackage(pkg_key, metadata)
cp = portage.dep_getkey(arg_atom)
new_world_atom = cp
+ sets = root_config.sets
+ portdb = root_config.trees["porttree"].dbapi
+ vardb = root_config.trees["vartree"].dbapi
available_slots = set(portdb.aux_get(cpv, ["SLOT"])[0] \
for cpv in portdb.match(cp))
- slotted = len(available_slots) > 1 or "0" not in available_slots
+ slotted = len(available_slots) > 1 or \
+ (len(available_slots) == 1 and "0" not in available_slots)
+ if not slotted:
+ # check the vdb in case this is multislot
+ available_slots = set(vardb.aux_get(cpv, ["SLOT"])[0] \
+ for cpv in vardb.match(cp))
+ slotted = len(available_slots) > 1 or \
+ (len(available_slots) == 1 and "0" not in available_slots)
if slotted and arg_atom != cp:
# If the user gave a specific atom, store it as a
# slot atom in the world file.
@@ -3065,7 +3075,7 @@ class depgraph(object):
favorites_set.findAtomForPackage(pkg_key, metadata):
# Maybe it will be added to world now.
if create_world_atom(pkg_key, metadata,
- favorites_set, root_config.sets, portdb):
+ favorites_set, root_config):
pkg_world = True
except portage.exception.InvalidDependString:
# This is reported elsewhere if relevant.
@@ -3280,7 +3290,7 @@ class depgraph(object):
self.mydbapi[root].aux_get(pkg_key, self._mydbapi_keys)))
try:
myfavkey = create_world_atom(pkg_key, metadata,
- args_set, root_config.sets, portdb)
+ args_set, root_config)
if myfavkey:
if myfavkey in added_favorites:
continue
@@ -3525,8 +3535,9 @@ class MergeTask(object):
del x, mytype, myroot, mycpv, mystatus, quiet_config
del shown_verifying_msg, quiet_settings
- system_set = SystemSet(self.settings)
- args_set = AtomSet(favorites)
+ root_config = RootConfig(self.trees[self.target_root])
+ system_set = root_config.sets["system"]
+ args_set = root_config.sets["world"]
world_set = WorldSet(self.settings)
if "--resume" not in self.myopts:
mymergelist = mylist
@@ -3819,8 +3830,7 @@ class MergeTask(object):
world_set.lock()
world_set.load()
myfavkey = create_world_atom(pkg_key, metadata,
- args_set, {"world":world_set, "system":system_set},
- portdb)
+ args_set, root_config)
if myfavkey:
world_set.add(myfavkey)
print ">>> Recording",myfavkey,"in \"world\" favorites file..."