From 37a999b34539547395dc86c6a6e2e3095fc4f800 Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Fri, 2 May 2008 04:17:52 +0000 Subject: add config option for package sets to not be recorded in 'world' svn path=/main/trunk/; revision=10077 --- cnf/sets.conf | 6 +++++- pym/_emerge/__init__.py | 2 +- pym/portage/sets/__init__.py | 4 ++++ pym/portage/sets/base.py | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cnf/sets.conf b/cnf/sets.conf index 252f487d5..c0921cec9 100644 --- a/cnf/sets.conf +++ b/cnf/sets.conf @@ -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 diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index d2068f1ae..18ad9abd1 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -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: diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py index 554b534bc..d688164b5 100644 --- a/pym/portage/sets/__init__.py +++ b/pym/portage/sets/__init__.py @@ -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 diff --git a/pym/portage/sets/base.py b/pym/portage/sets/base.py index 50702cff3..d64b632f9 100644 --- a/pym/portage/sets/base.py +++ b/pym/portage/sets/base.py @@ -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() -- cgit v1.2.3-1-g7c22