diff options
authorZac Medico <zmedico@gentoo.org>2009-10-18 21:06:39 (GMT)
committerZac Medico <zmedico@gentoo.org>2009-10-18 21:06:39 (GMT)
commit84de8f714de5d4599c5ea8dd207ed237b6a3c883 (patch)
parentRevert r14677 since it doesn't interact well with the 'extend', 'remove', and (diff)
Remove support for 'extend', 'remove', and 'intersect' sets.conf section
attributes in SetConfig.getSetAtoms() since the current implementation does not meet user expectations, as mentioned in bug #253802, comment #5: Package set operators currently operate on atoms, but what users really need is for them to operate on the packages themselves. This will allow one set to add or subtract packages from another even though the sets to not use the exact same atoms to refer to the given packages. I imagine the way this should be done is to create a mapping of atom -> package for each set, perform the intersection using the packages, and then map the package intersection back into a set of atoms. svn path=/main/trunk/; revision=14679
1 files changed, 3 insertions, 26 deletions
diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py
index bb59bd5..59c3dbf 100644
--- a/pym/portage/sets/__init__.py
+++ b/pym/portage/sets/__init__.py
@@ -155,44 +155,21 @@ class SetConfig(object):
raise PackageSetNotFound(setname)
myatoms = myset.getAtoms()
parser = self._parser
- extend = set()
- remove = set()
- intersect = set()
if ignorelist is None:
ignorelist = set()
- # If sets.conf is corrupt then emerge generates
- # fallback sets without the 'creator' attribute.
- if setname not in ignorelist and hasattr(myset, 'creator'):
- if parser.has_option(myset.creator, "extend"):
- extend.update(parser.get(myset.creator, "extend").split())
- if parser.has_option(myset.creator, "remove"):
- remove.update(parser.get(myset.creator, "remove").split())
- if parser.has_option(myset.creator, "intersect"):
- intersect.update(parser.get(myset.creator, "intersect").split())
for n in myset.getNonAtoms():
if n.startswith(SETPREFIX):
s = n[len(SETPREFIX):]
if s in self.psets:
- extend.add(n[len(SETPREFIX):])
+ if s not in ignorelist:
+ myatoms.update(self.getSetAtoms(s,
+ ignorelist=ignorelist))
raise PackageSetNotFound(s)
- 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=ignorelist))
- for s in intersect:
- myatoms.intersection_update(self.getSetAtoms(s, ignorelist=ignorelist))
return myatoms
def load_default_config(settings, trees):