From fd52521ee932a9e71e432a23cd31920e190b8e81 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 19 Oct 2009 03:43:21 +0000 Subject: [PATCH] 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. (trunk r14679) svn path=/main/branches/2.1.7/; revision=14690 --- pym/portage/_sets/__init__.py | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py index 3baa6f4cb..a4581cd43 100644 --- a/pym/portage/_sets/__init__.py +++ b/pym/portage/_sets/__init__.py @@ -172,44 +172,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()) - ignorelist.add(setname) 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)) else: 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): -- 2.26.2