Make SetConfig.getSets() return a copy of the psets attribute
authorZac Medico <zmedico@gentoo.org>
Wed, 5 Dec 2007 08:46:03 +0000 (08:46 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 5 Dec 2007 08:46:03 +0000 (08:46 -0000)
instead of a direct reference. Fix the to stop relying on
having the direct reference.

svn path=/main/trunk/; revision=8849

pym/_emerge/__init__.py
pym/portage/sets/__init__.py

index 97b273177fb494df42f9b41d61bd1cd67d2da8f9..b0ad6391b500dc6d211b426a3d0653e0e37d2bc1 100644 (file)
@@ -6908,7 +6908,7 @@ def emerge_main():
        if myaction in ("clean", "config", "depclean", "info", "prune", "unmerge", None):
                root_config = trees[settings["ROOT"]]["root_config"]
                setconfig = root_config.setconfig
-               sets = root_config.sets
+               sets = setconfig.getSets()
                # emerge relies on the existance of sets with names "world" and "system"
                required_sets = ("world", "system")
                if "system" not in sets:
@@ -6918,6 +6918,7 @@ def emerge_main():
                if "world" not in sets:
                        from portage.sets.files import WorldSet
                        sets["world"] = WorldSet(root_config.root)
+               setconfig.psets.update(sets)
                for s in required_sets:
                        if s not in sets:
                                msg = ["emerge: incomplete set configuration, " + \
index 2d36f481406bea3c32a440bd90eaa41418fb16f1..5f82b69b7492fd12db45526af163211b0c510e07 100644 (file)
@@ -74,7 +74,7 @@ class SetConfig(SafeConfigParser):
        
        def getSets(self):
                self._parse()
-               return self.psets
+               return self.psets.copy()
 
        def getSetAtoms(self, setname, ignorelist=None):
                myset = self.getSets()[setname]