Bug #266454 - Make @world an all-inclusive set once again, like it was prior
authorZac Medico <zmedico@gentoo.org>
Fri, 16 Oct 2009 22:47:55 +0000 (22:47 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 16 Oct 2009 22:47:55 +0000 (22:47 -0000)
to portage-2.2_rc* releases. In addition to @system, @world now includes a
@selected set which represents user-selected "world" packages and sets that
saved in /var/lib/portage/world{,sets}.

svn path=/main/trunk/; revision=14614

13 files changed:
RELEASE-NOTES
cnf/sets.conf
doc/config/sets.docbook
man/emerge.1
man/portage.5
pym/_emerge/Scheduler.py
pym/_emerge/actions.py
pym/_emerge/create_world_atom.py
pym/_emerge/depgraph.py
pym/_emerge/help.py
pym/_emerge/main.py
pym/_emerge/unmerge.py
pym/portage/sets/files.py

index 81ac86682ac4b6f99060c9ae1bec372bba3fd98c..b4908beb521ecc07936151a7fa8751df6629c1f7 100644 (file)
@@ -18,8 +18,9 @@ portage-2.2
   - 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
 ==================================
index a921a2bb14a785fe705b34caf1c26ec57fa9be4a..87242ce59f33f28365f5f2fa2be1835dfe1ecb42 100644 (file)
@@ -6,7 +6,13 @@
 
 # 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
index e50c85cc9b4a1514efa0a877eba21fcf69fbcd75..8f93b1df2d33641564cf059c69c778f254c999da 100644 (file)
                        <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>
index 4e33573de2f86cc7f9300e58a06671781d614761..fc0a880ebb08e72af5c4b8dbe56be663c6993714 100644 (file)
@@ -58,10 +58,13 @@ would like to query the owners of one or more files or directories.
 .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
@@ -105,7 +108,7 @@ setups that the user may wish to run.
 .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
@@ -114,7 +117,7 @@ always be kept. They can be manually added to this set with \fIemerge
 \-\-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
@@ -300,7 +303,7 @@ and old version to be displayed in an aligned format for easy cut\-n\-paste.
 .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
index bcf0658255e0fed1adc581b1dcc132fe8b1556ee..d81232f1c42cf3be0cb997b08edab5182e786f68 100644 (file)
@@ -894,7 +894,7 @@ packages sets which always begin with the @ character.
 
 .I Example:
 .nf
-@system
+@kde
 .fi
 .RE
 .SH "REPORTING BUGS"
index eb2f894973069c77adc394b3516ba4527e162bfd..c95003dd76579bea42a2a2fa7e9154984b54ceae 100644 (file)
@@ -1629,7 +1629,7 @@ class Scheduler(PollScheduler):
                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()
index bc0a518f120d83c13818dbd919ca64043dc403be..febe3b545eec3957e9b2f60ab3ec5b0778a0bc1c 100644 (file)
@@ -566,7 +566,7 @@ def action_depclean(settings, trees, ldpath_mtimes,
        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:
@@ -614,7 +614,7 @@ def action_depclean(settings, trees, ldpath_mtimes,
 
        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))
@@ -634,7 +634,7 @@ def calc_depclean(settings, trees, ldpath_mtimes,
        vardb = trees[myroot]["vartree"].dbapi
        deselect = myopts.get('--deselect') != 'n'
 
-       required_set_names = ("system", "world")
+       required_set_names = ("world",)
        required_sets = {}
        set_args = []
 
@@ -647,7 +647,7 @@ def calc_depclean(settings, trees, ldpath_mtimes,
        # 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:
 
@@ -787,7 +787,7 @@ def calc_depclean(settings, trees, ldpath_mtimes,
                                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 " + \
@@ -1176,9 +1176,9 @@ def calc_depclean(settings, trees, ldpath_mtimes,
 
 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
 
index 30ade0acf4413fc11494b8e8b23b4613296359cd..7ded8af13af93295d5e0d34b862e633bc2bce4ed 100644 (file)
@@ -68,7 +68,7 @@ def create_world_atom(pkg, args_set, root_config):
                        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:
index 525a052964f708ae84a85c550ff3ec0c03ac5e41..de60bd801146672ee53caf40369fff644438a54e 100644 (file)
@@ -90,7 +90,7 @@ class _frozen_depgraph_config(object):
                        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):
 
@@ -1756,7 +1756,7 @@ class depgraph(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
@@ -1783,7 +1783,7 @@ class depgraph(object):
                                                # 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
@@ -3486,7 +3486,7 @@ class depgraph(object):
                                                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:
@@ -3775,7 +3775,7 @@ class depgraph(object):
                                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
 
@@ -4428,7 +4428,7 @@ class depgraph(object):
                                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
@@ -4647,9 +4647,9 @@ class depgraph(object):
                        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
 
@@ -4698,7 +4698,7 @@ class depgraph(object):
                                        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")
@@ -4729,7 +4729,7 @@ class depgraph(object):
                        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"):
@@ -4761,7 +4761,8 @@ class depgraph(object):
                                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:
index e2c7a80ea8b8fd090375302457d6f80c88ef8f79..50145dad5c9b4c22af2df1ce5257e9ef6951c894 100644 (file)
@@ -70,8 +70,8 @@ def help(myopts, havecolor=1):
 
                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 " + \
@@ -80,7 +80,7 @@ def help(myopts, havecolor=1):
                "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):
@@ -312,7 +312,7 @@ def help(myopts, havecolor=1):
                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" + \
index 667a811dfc0ad2c8c8e4690717abdb0fdb9a7f8f..3e445b2e8c43d62e17d62c4079ad0cd8b185f2b4 100644 (file)
@@ -904,8 +904,8 @@ def expand_set_arguments(myfiles, myaction, root_config):
        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:
index 4d2a546c5b2915bb8a3d8ace3916d6d2ab73280b..967d72478b40f809894748f31fffcf3d802b504e 100644 (file)
@@ -283,9 +283,9 @@ def unmerge(root_config, myopts, unmerge_action,
        
        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:
@@ -333,7 +333,8 @@ def unmerge(root_config, myopts, unmerge_action,
                                # 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:
@@ -510,22 +511,22 @@ def unmerge(root_config, myopts, unmerge_action,
                                        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
 
index e8650becdd3ce4d341d80b493921a50637f27bc4..f4b35037e5567849b60c0c350e560bcd50ab590f 100644 (file)
@@ -21,7 +21,7 @@ from portage.env.loaders import ItemFileLoader, KeyListFileLoader
 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"]
@@ -205,11 +205,11 @@ class ConfigFileSet(PackageSet):
                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
@@ -324,5 +324,5 @@ class WorldSet(EditablePackageSet):
                self.replace(newworldlist)
 
        def singleBuilder(self, options, settings, trees):
-               return WorldSet(settings["ROOT"])
+               return WorldSelectedSet(settings["ROOT"])
        singleBuilder = classmethod(singleBuilder)