break potential cycles in set expansion
authorMarius Mauch <genone@gentoo.org>
Fri, 26 Oct 2007 01:07:06 +0000 (01:07 -0000)
committerMarius Mauch <genone@gentoo.org>
Fri, 26 Oct 2007 01:07:06 +0000 (01:07 -0000)
svn path=/main/trunk/; revision=8303

pym/portage/sets/__init__.py

index 1d39d10ee0246879c2a340257909592bdc84807b..315747f10e6256219b972b0264ea49cefafbfd81 100644 (file)
@@ -94,12 +94,14 @@ class SetConfig(SafeConfigParser):
                        self.aliases = shortnames
                return self.aliases
 
-       def getSetAtoms(self, setname):
+       def getSetAtoms(self, setname, ignorelist=[]):
                myset = self.getSetsWithAliases()[setname]
                myatoms = myset.getAtoms()
+               ignorelist.append(setname)
                for n in myset.getNonAtoms():
                        if n[0] == SETPREFIX and n[1:] in self.aliases:
-                               myatoms.update(self.getSetAtoms(n))
+                               if n[1:] not in ignorelist:
+                                       myatoms.update(self.getSetAtoms(n), ignorelist=ignorelist)
                return myatoms
 
 def make_default_config(settings, trees):