diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-10-18 21:06:39 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-10-18 21:06:39 +0000 |
commit | 84de8f714de5d4599c5ea8dd207ed237b6a3c883 (patch) | |
tree | 41404165dd7766cdc327555412cef867de0e676d | |
parent | f2e3f317c18b82175c91b86b29fe1b253811faec (diff) | |
download | portage-84de8f714de5d4599c5ea8dd207ed237b6a3c883.tar.gz portage-84de8f714de5d4599c5ea8dd207ed237b6a3c883.tar.bz2 portage-84de8f714de5d4599c5ea8dd207ed237b6a3c883.zip |
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
-rw-r--r-- | pym/portage/sets/__init__.py | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py index bb59bd542..59c3dbfd7 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()) - 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): |