- packages won't be unmerged if they are referenced by an installed package
set (with the exception of the world set, and installed being determined
by the world_sets file).
-* "world" no longer includes "system" unconditionally, but you can add
- "@system" to the world_sets file to restore the old state.
+* "world" now includes separate "selected" and "system" sets, where the
+ "selected" set includes packages listed in /var/lib/portage/world and nested
+ sets that may be listed /var/lib/portage/world_sets.
portage-2.1.7
==================================
# Not much that could be changed for world, so better leave it alone
[world]
-class = portage.sets.files.WorldSet
+class = portage.sets.base.DummyPackageSet
+world-candidate = False
+packages = @selected @system
+
+# Not much that could be changed for world, so better leave it alone
+[selected]
+class = portage.sets.files.WorldSelectedSet
world-candidate = False
# Same as for world, though later portage versions might use a different class
<programlisting>
# The classic world set
[world]
- class = portage.sets.files.WorldSet
+ class = portage.sets.base.DummyPackageSet
world-candidate = False
-
+ packages = @selected @system
+
+ # The selected set
+ [selected]
+ class = portage.sets.files.WorldSelectedSet
+ world-candidate = False
+
# The classic system set
[system]
class = portage.sets.profiles.PackagesSystemSet
</sect3>
</sect2>
- <sect2 id='config-set-classes-WorldSet'>
- <title>portage.sets.files.WorldSet</title>
+ <sect2 id='config-set-classes-WorldSelectedSet'>
+ <title>portage.sets.files.WorldSelectedSet</title>
<para>
A minor variation of <classname>StaticFileSet</classname>, mainly for implementation
reasons. It should never be used in user configurations as it's already configured
The default sets are:
</para>
<itemizedlist>
+ <listitem><para><varname>world</varname>: uses <classname>DummySet</classname></para></listitem>
+ <listitem><para><varname>selected</varname>: uses <classname>WorldSelectedSet</classname></para></listitem>
<listitem><para><varname>system</varname>: uses <classname>PackagesSystemSet</classname></para></listitem>
- <listitem><para><varname>world</varname>: uses <classname>WorldSet</classname></para></listitem>
<listitem><para><varname>security</varname>: uses <classname>NewAffectedSet</classname> with default options</para></listitem>
<listitem><para><varname>installed</varname>: uses <classname>EverythingSet</classname></para></listitem>
<listitem><para><varname>preserved-rebuild</varname>: uses <classname>PreservedLibraryConsumerSet</classname></para></listitem>
.TP
.BR set
A \fIset\fR is a convenient shorthand for a large group of
-packages. Two sets are currently always available: \fBsystem\fR
-and \fBworld\fR. \fBsystem\fR refers to a set of packages
-deemed necessary for your system to run properly. \fBworld\fR
-contains all the packages listed in \fB/var/lib/portage/world\fR. [See
+packages. Three sets are currently always available: \fBselected\fR,
+\fBsystem\fR and \fBworld\fR. \fBselected\fR contains the user-selected
+"world" packages that are listed in \fB/var/lib/portage/world\fR,
+and nested sets that may be listed
+in \fB/var/lib/portage/world_sets\fR. \fBsystem\fR refers to a set of
+packages deemed necessary for your system to run properly. \fBworld\fR
+encompasses both the \fBselected\fR and \fBsystem\fR sets. [See
\fBFILES\fR below for more information.] Other sets can exist depending
on the current configuration. The default set configuration is located
in \fB/usr/share/portage/config/sets.conf\fR. Note that a \fIset\fR
.BR \-\-depclean
Cleans the system by removing packages that are not associated
with explicitly merged packages. Depclean works by creating the
-full dependency tree from the @system and @world sets,
+full dependency tree from the @world set,
then comparing it to installed packages. Packages installed, but
not part of the dependency tree, will be uninstalled by depclean.
See \fB\-\-with\-bdeps\fR for behavior with respect to build time dependencies
\-\-noreplace <atom>\fR. As a safety measure, depclean will not remove any
packages unless *all* required dependencies have been resolved. As a
consequence, it is often necessary to run \fIemerge \-\-update \-\-newuse
-\-\-deep @system @world\fR prior to depclean.
+\-\-deep @world\fR prior to depclean.
\fBWARNING:\fR
Inexperienced users are advised to use \fB\-\-pretend\fR with this
.TP
.BR "\-\-complete\-graph[=n]"
This causes \fBemerge\fR to consider the deep dependencies of all
-packages from the system and world sets. With this option enabled,
+packages from the world set. With this option enabled,
\fBemerge\fR will bail out if it determines that the given operation will
break any dependencies of the packages that have been added to the
graph. Like the \fB\-\-deep\fR option, the \fB\-\-complete\-graph\fR
.I Example:
.nf
-@system
+@kde
.fi
.RE
.SH "REPORTING BUGS"
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()
msg.append("unless *all* required dependencies have been resolved. As a\n")
msg.append("consequence, it is often necessary to run %s\n" % \
good("`emerge --update"))
- msg.append(good("--newuse --deep @system @world`") + \
+ msg.append(good("--newuse --deep @world`") + \
" prior to depclean.\n")
if action == "depclean" and "--quiet" not in myopts and not myfiles:
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:
msg.append(" %s" % (parent,))
msg.append("")
msg.append("Have you forgotten to run " + \
- good("`emerge --update --newuse --deep @system @world`") + " prior")
+ good("`emerge --update --newuse --deep @world`") + " prior")
msg.append(("to %s? It may be necessary to manually " + \
"uninstall packages that no longer") % action)
msg.append("exist in the portage tree since " + \
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:
if not parent_atoms:
atom = self._dynamic_config._blocked_world_pkgs.get(pkg)
if atom is not None:
- parent_atoms = set([("@world", atom)])
+ parent_atoms = set([("@selected", atom)])
if parent_atoms:
conflict_pkgs[pkg] = parent_atoms
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:
paragraph = "Cleans the system by removing packages that are " + \
"not associated with explicitly merged packages. Depclean works " + \
- "by creating the full dependency tree from the @system and " + \
- "@world sets, then comparing it to installed packages. Packages " + \
+ "by creating the full dependency tree from the " + \
+ "@world set, then comparing it to installed packages. Packages " + \
"installed, but not part of the dependency tree, will be " + \
"uninstalled by depclean. See --with-bdeps for behavior with " + \
"respect to build time dependencies that are not strictly " + \
"emerge --noreplace <atom>. As a safety measure, depclean " + \
"will not remove any packages unless *all* required dependencies " + \
"have been resolved. As a consequence, it is often necessary to " + \
- "run emerge --update --newuse --deep @system @world " + \
+ "run emerge --update --newuse --deep @world " + \
"prior to depclean."
for line in wrap(paragraph, desc_width):
print()
print(" "+green("--complete-graph") + "[=%s]" % turquoise("n"))
desc = "This causes emerge to consider the deep dependencies of all" + \
- " packages from the system and world sets. With this option enabled," + \
+ " packages from the world set. With this option enabled," + \
" emerge will bail out if it determines that the given operation will" + \
" break any dependencies of the packages that have been added to the" + \
" graph. Like the --deep option, the --complete-graph" + \
for e in setconfig.errors:
print(colorize("BAD", "Error during set creation: %s" % e))
- # emerge relies on the existance of sets with names "world" and "system"
- required_sets = ("world", "system")
+ # emerge requires existence of "world", "selected", and "system"
+ required_sets = ("selected", "system", "world",)
missing_sets = []
for s in required_sets:
from portage.sets.base import EditablePackageSet
- # generate a list of package sets that are directly or indirectly listed in "world",
+ # generate a list of package sets that are directly or indirectly listed in "selected",
# as there is no persistent list of "installed" sets
- installed_sets = ["world"]
+ installed_sets = ["selected"]
stop = False
pos = 0
while not stop:
# skip sets that the user requested to unmerge, and skip world
# unless we're unmerging a package set (as the package would be
# removed from "world" later on)
- if s in root_config.setconfig.active or (s == "world" and not root_config.setconfig.active):
+ if s in root_config.setconfig.active or \
+ (s == "selected" and not root_config.setconfig.active):
continue
if s not in sets:
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
from portage.env.validators import ValidAtomValidator
from portage import dep_getkey, cpv_getkey
-__all__ = ["StaticFileSet", "ConfigFileSet", "WorldSet"]
+__all__ = ["StaticFileSet", "ConfigFileSet", "WorldSelectedSet"]
class StaticFileSet(EditablePackageSet):
_operations = ["merge", "unmerge"]
return rValue
multiBuilder = classmethod(multiBuilder)
-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
self.replace(newworldlist)
def singleBuilder(self, options, settings, trees):
- return WorldSet(settings["ROOT"])
+ return WorldSelectedSet(settings["ROOT"])
singleBuilder = classmethod(singleBuilder)