logger = self._logger
pkg_count = self._pkg_count
root_config = pkg.root_config
- world_set = root_config.sets["world"]
+ world_set = root_config.sets["selected"]
world_locked = False
if hasattr(world_set, "lock"):
world_set.lock()
print("Packages installed: " + str(len(vardb.cpv_all())))
print("Packages in world: " + \
- str(len(root_config.sets["world"].getAtoms())))
+ str(len(root_config.sets["selected"].getAtoms())))
print("Packages in system: " + \
str(len(root_config.sets["system"].getAtoms())))
print("Required packages: "+str(req_pkg_count))
vardb = trees[myroot]["vartree"].dbapi
deselect = myopts.get('--deselect') != 'n'
- required_set_names = ("system", "world")
+ required_set_names = ("world",)
required_sets = {}
set_args = []
# which excludes packages that are intended to be eligible for
# removal.
world_temp_set = required_sets["world"]
- system_set = required_sets["system"]
+ system_set = root_config.sets["system"]
if not system_set or not world_temp_set:
def action_deselect(settings, trees, opts, atoms):
root_config = trees[settings['ROOT']]['root_config']
- world_set = root_config.sets['world']
+ world_set = root_config.sets['selected']
if not hasattr(world_set, 'update'):
- writemsg_level("World set does not appear to be mutable.\n",
+ writemsg_level("World @selected set does not appear to be mutable.\n",
level=logging.ERROR, noiselevel=-1)
return 1
if len(matched_slots) == 1:
new_world_atom = slot_atom
- if new_world_atom == sets["world"].findAtomForPackage(pkg):
+ if new_world_atom == sets["selected"].findAtomForPackage(pkg):
# Both atoms would be identical, so there's nothing to add.
return None
if not slotted:
self.pkgsettings[myroot] = portage.config(
clone=self.trees[myroot]["vartree"].settings)
- self._required_set_names = set(["system", "world"])
+ self._required_set_names = set(["world"])
class _dynamic_depgraph_config(object):
continue
if not (isinstance(arg, SetArg) and \
- arg.name in ("system", "world")):
+ arg.name in ("selected", "system", "world")):
self._dynamic_config._unsatisfied_deps_for_display.append(
((myroot, atom), {}))
return 0, myfavorites
# out here if the atom is not from either the system or
# world set.
if not (isinstance(arg, SetArg) and \
- arg.name in ("system", "world")):
+ arg.name in ("selected", "system", "world")):
return 0, myfavorites
# Add the selected package to the graph as soon as possible
skip = False
try:
for atom in root_config.sets[
- "world"].iterAtomsForPackage(task):
+ "selected"].iterAtomsForPackage(task):
satisfied = False
for pkg in graph_db.match_pkgs(atom):
if pkg == inst_pkg:
pkg_cp = xs[0]
root_config = self._frozen_config.roots[myroot]
system_set = root_config.sets["system"]
- world_set = root_config.sets["world"]
+ world_set = root_config.sets["selected"]
pkg_system = False
pkg_world = False
if "world" in self._dynamic_config._sets:
# Filter out indirect members of world (from nested sets)
# since only direct members of world are desired here.
- world_set = self._frozen_config.roots[self._frozen_config.target_root].sets["world"]
+ world_set = self._frozen_config.roots[self._frozen_config.target_root].sets["selected"]
for arg, atom in self._dynamic_config._missing_args:
- if arg.name == "world" and atom in world_set:
+ if arg.name in ("selected", "world") and atom in world_set:
world_problems = True
break
ref_string = " pulled in by " + ref_string
msg.append(" %s%s\n" % (colorize("INFORM", str(arg)), ref_string))
msg.append("\n")
- if "world" in problems_sets:
+ if "selected" in problems_sets or "world" in problems_sets:
msg.append("This problem can be solved in one of the following ways:\n\n")
msg.append(" A) Use emaint to clean offending packages from world (if not installed).\n")
msg.append(" B) Uninstall offending packages (cleans them from world).\n")
if x in self._frozen_config.myopts:
return
root_config = self._frozen_config.roots[self._frozen_config.target_root]
- world_set = root_config.sets["world"]
+ world_set = root_config.sets["selected"]
world_locked = False
if hasattr(world_set, "lock"):
del e
all_added = []
for k in self._dynamic_config._sets:
- if k in ("args", "world") or not root_config.sets[k].world_candidate:
+ if k in ("args", "selected", "world") or \
+ not root_config.sets[k].world_candidate:
continue
s = SETPREFIX + k
if s in world_set:
raise UninstallFailure(retval)
sys.exit(retval)
else:
- if clean_world and hasattr(sets["world"], "cleanPackage")\
- and hasattr(sets["world"], "lock"):
- sets["world"].lock()
- if hasattr(sets["world"], "load"):
- sets["world"].load()
- sets["world"].cleanPackage(vartree.dbapi, y)
- sets["world"].unlock()
+ if clean_world and hasattr(sets["selected"], "cleanPackage")\
+ and hasattr(sets["selected"], "lock"):
+ sets["selected"].lock()
+ if hasattr(sets["selected"], "load"):
+ sets["selected"].load()
+ sets["selected"].cleanPackage(vartree.dbapi, y)
+ sets["selected"].unlock()
emergelog(xterm_titles, " >>> unmerge success: "+y)
- if clean_world and hasattr(sets["world"], "remove")\
- and hasattr(sets["world"], "lock"):
- sets["world"].lock()
+ if clean_world and hasattr(sets["selected"], "remove")\
+ and hasattr(sets["selected"], "lock"):
+ sets["selected"].lock()
# load is called inside remove()
for s in root_config.setconfig.active:
- sets["world"].remove(SETPREFIX+s)
- sets["world"].unlock()
+ sets["selected"].remove(SETPREFIX + s)
+ sets["selected"].unlock()
return 1
# system and world sets is hardcoded below.
parser = self._parser
+ parser.add_section("world")
+ parser.set("world", "class", "portage._sets.base.DummyPackageSet")
+ parser.set("world", "world-candidate", "False")
+ parser.set("world", "packages", "@selected @system")
+
+ parser.add_section("selected")
+ parser.set("selected", "class", "portage._sets.files.WorldSelectedSet")
+ parser.set("selected", "world-candidate", "False")
+
parser.add_section("system")
parser.set("system", "class", "portage._sets.profiles.PackagesSystemSet")
parser.set("system", "world-candidate", "False")
- parser.add_section("world")
- parser.set("world", "class", "portage._sets.files.WorldSet")
- parser.set("world", "world-candidate", "False")
-
self.errors = []
self.psets = {}
self.trees = trees
from portage.env.validators import ValidAtomValidator
from portage import dep_getkey, cpv_getkey
-__all__ = ["WorldSet",]
+__all__ = ["WorldSelectedSet",]
-class WorldSet(EditablePackageSet):
+class WorldSelectedSet(EditablePackageSet):
description = "Set of packages that were directly installed by the user"
def __init__(self, root):
- super(WorldSet, self).__init__()
+ super(WorldSelectedSet, self).__init__()
# most attributes exist twice as atoms and non-atoms are stored in
# separate files
self._lock = None
def load(self):
atoms = []
- nonatoms = ["@system"]
+ nonatoms = []
atoms_changed = False
# load atoms and non-atoms from different files so the worldfile is
# backwards-compatible with older versions and other PMs, even though
self.replace(newworldlist)
def singleBuilder(self, options, settings, trees):
- return WorldSet(settings["ROOT"])
+ return WorldSelectedSet(settings["ROOT"])
singleBuilder = classmethod(singleBuilder)