add config option for package sets to not be recorded in 'world'
authorMarius Mauch <genone@gentoo.org>
Fri, 2 May 2008 04:17:52 +0000 (04:17 -0000)
committerMarius Mauch <genone@gentoo.org>
Fri, 2 May 2008 04:17:52 +0000 (04:17 -0000)
svn path=/main/trunk/; revision=10077

cnf/sets.conf
pym/_emerge/__init__.py
pym/portage/sets/__init__.py
pym/portage/sets/base.py

index 252f487d597ceed8f7c717e27eedd7685e1a3788..c0921cec9fa0d146fd6259088328fec4c1bac075 100644 (file)
@@ -7,6 +7,7 @@
 # Not much that could be changed for world, so better leave it alone
 [world]
 class = portage.sets.files.WorldSet
+world-candidate = False
 
 # Same as for world, though later portage versions might use a different class
 [system]
@@ -21,13 +22,15 @@ class = portage.sets.profiles.PackagesSystemSet
 # - SecuritySet: include all GLSAs
 [security]
 class = portage.sets.security.NewAffectedSet
+world-candidate = False
 
 # Again, not much to change here, though people might prefer a different name
 [everything]
 class = portage.sets.dbapi.EverythingSet
+world-candidate = False
 
 # The following treats all files in /etc/portage/sets as a package set called
-# 'sets/$filename'.
+# '$filename'.
 [usersets]
 class = portage.sets.files.StaticFileSet
 multiset = true
@@ -37,3 +40,4 @@ directory = /etc/portage/sets
 # to FEATURES=preserve-libs
 [preserved-rebuild]
 class = portage.sets.dbapi.PreservedLibraryConsumerSet
+world-candidate = False
index d2068f1ae2439f522c4916ffadfab466446360bc..18ad9abd1c9288eb1b9a158e4fe8f2c6d2309f39 100644 (file)
@@ -4738,7 +4738,7 @@ class depgraph(object):
                                del e
                all_added = []
                for k in self._sets:
-                       if k in ("args", "world"):
+                       if k in ("args", "world") or not root_config.sets[k].world_candidate:
                                continue
                        s = SETPREFIX + k
                        if s in world_set:
index 554b534bc7549b4f09e8c63231da973ba7c3633f..d688164b58246c5ebde28f1000c37a9bfcaacecb 100644 (file)
@@ -67,6 +67,8 @@ class SetConfig(SafeConfigParser):
                                                if x in self.psets:
                                                        self.errors.append("Redefinition of set '%s' (sections: '%s', '%s')" % (setname, self.psets[setname].creator, sname))
                                                newsets[x].creator = sname
+                                               if self.has_option(sname, "world-candidate") and not self.getboolean(sname, "world-candidate"):
+                                                       newsets[x].world_candidate = False
                                        self.psets.update(newsets)
                                else:
                                        self.errors.append("Section '%s' is configured as multiset, but '%s' doesn't support that configuration" % (sname, classname))
@@ -82,6 +84,8 @@ class SetConfig(SafeConfigParser):
                                        try:
                                                self.psets[setname] = setclass.singleBuilder(optdict, self.settings, self.trees)
                                                self.psets[setname].creator = sname
+                                               if self.has_option(sname, "world-candidate") and not self.getboolean(sname, "world-candidate"):
+                                                       self.psets[setname].world_candidate = False
                                        except SetConfigError, e:
                                                self.errors.append("Configuration error in section '%s': %s" % (sname, str(e)))
                                                continue
index 50702cff39c9d97c951fe31d9bf538a5b99838ff..d64b632f9d8d2691fe4e82074410df3eaf625da7 100644 (file)
@@ -24,6 +24,7 @@ class PackageSet(object):
                self._loading = False
                self.errors = []
                self._nonatoms = set()
+               self.world_candidate = True
 
        def __contains__(self, atom):
                self._load()