diff options
author | Marius Mauch <genone@gentoo.org> | 2008-09-28 17:27:44 +0000 |
---|---|---|
committer | Marius Mauch <genone@gentoo.org> | 2008-09-28 17:27:44 +0000 |
commit | 2f9c5ff0157ec37b2009256b333191c360f57867 (patch) | |
tree | d51d273445df37548a87c9a032a51b5aa01a1c38 | |
parent | 5883ba88a08f0d8f802b7ca3a251f0165f902b1a (diff) | |
download | portage-2f9c5ff0157ec37b2009256b333191c360f57867.tar.gz portage-2f9c5ff0157ec37b2009256b333191c360f57867.tar.bz2 portage-2f9c5ff0157ec37b2009256b333191c360f57867.zip |
Add operator logic to sets.conf
svn path=/main/trunk/; revision=11584
-rw-r--r-- | pym/portage/sets/__init__.py | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py index 022e31897..28fcf58a5 100644 --- a/pym/portage/sets/__init__.py +++ b/pym/portage/sets/__init__.py @@ -123,14 +123,38 @@ class SetConfig(SafeConfigParser): def getSetAtoms(self, setname, ignorelist=None): myset = self.getSets()[setname] myatoms = myset.getAtoms() + + extend = set() + remove = set() + intersect = set() + if ignorelist is None: ignorelist = set() + if not setname in ignorelist: + if self.has_option(myset.creator, "extend"): + extend.update(self.get(myset.creator, "extend").split()) + if self.has_option(myset.creator, "remove"): + remove.update(self.get(myset.creator, "remove").split()) + if self.has_option(myset.creator, "intersect"): + intersect.update(self.get(myset.creator, "intersect").split()) + ignorelist.add(setname) for n in myset.getNonAtoms(): - if n[0] == SETPREFIX and n[1:] in self.psets: - if n[1:] not in ignorelist: - myatoms.update(self.getSetAtoms(n[1:], - ignorelist=ignorelist)) + if n.startswith(SETPREFIX) and n[len(SETPREFIX):] in self.psets: + extend.add(n[len(SETPREFIX):]) + + for s in ignorelist: + extend.discard(s) + remove.discard(s) + intersect.discard(s) + + for s in extend: + myatoms.update(self.getSetAtoms(s, ignorelist=ignorelist)) + for s in remove: + myatoms.difference_update(self.getSetAtoms(s, ignorelist=None)) + for s in intersect: + myatoms.intersection_update(self.getSetAtoms(s, ignorelist=None)) + return myatoms def load_default_config(settings, trees): |