diff options
-rw-r--r-- | pym/portage/sets/__init__.py | 8 | ||||
-rw-r--r-- | pym/portage/sets/base.py | 9 |
2 files changed, 16 insertions, 1 deletions
diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py index b757c43c4..8497e1587 100644 --- a/pym/portage/sets/__init__.py +++ b/pym/portage/sets/__init__.py @@ -92,6 +92,14 @@ class SetConfig(SafeConfigParser): self.aliases = shortnames return self.aliases + def getSetAtoms(self, setname): + myset = self.getSetsWithAliases()[setname] + myatoms = myset.getAtoms() + for n in myset.getNonAtoms(): + if n in self.aliases: + myatoms.update(self.getSetAtoms(n)) + return myatoms + def make_default_config(settings, trees): sc = SetConfig([], settings, trees) sc.add_section("security") diff --git a/pym/portage/sets/base.py b/pym/portage/sets/base.py index b5ea88928..1f3858137 100644 --- a/pym/portage/sets/base.py +++ b/pym/portage/sets/base.py @@ -23,6 +23,7 @@ class PackageSet(object): self._loaded = False self._loading = False self.errors = [] + self._nonatoms = set() def __contains__(self, atom): return atom in self.getAtoms() @@ -44,13 +45,19 @@ class PackageSet(object): self._loading = False return self._atoms + def getNonAtoms(self): + self.getAtoms() + return self._nonatoms + def _setAtoms(self, atoms): atoms = map(str.strip, atoms) + nonatoms = set() for a in atoms[:]: if a == "": atoms.remove(a) elif not isvalidatom(a): - raise InvalidAtom(a) + atoms.remove(a) + self._nonatoms.add(a) self._atoms = set(atoms) self._updateAtomMap() |