diff options
Diffstat (limited to 'bin/emerge')
-rwxr-xr-x | bin/emerge | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/bin/emerge b/bin/emerge index 187d7e97b..7bdceda96 100755 --- a/bin/emerge +++ b/bin/emerge @@ -687,7 +687,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 @@ -697,9 +697,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. @@ -3036,7 +3046,7 @@ class depgraph: 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. @@ -3251,7 +3261,7 @@ class depgraph: 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 @@ -3494,8 +3504,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 @@ -3784,8 +3795,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..." |