summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-05 08:46:03 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-05 08:46:03 +0000
commitbfea56f256dfbc5d945d0a8d28e3e586d5734f98 (patch)
tree6d99f8141c71e64cfaff2fa6db290ec10013f271
parentedf3f42f2c8a9c1096e17239e4b1b8d6dd78ed2f (diff)
downloadportage-bfea56f256dfbc5d945d0a8d28e3e586d5734f98.tar.gz
portage-bfea56f256dfbc5d945d0a8d28e3e586d5734f98.tar.bz2
portage-bfea56f256dfbc5d945d0a8d28e3e586d5734f98.zip
Make SetConfig.getSets() return a copy of the psets attribute
instead of a direct reference. Fix the to stop relying on having the direct reference. svn path=/main/trunk/; revision=8849
-rw-r--r--pym/_emerge/__init__.py3
-rw-r--r--pym/portage/sets/__init__.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 97b273177..b0ad6391b 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -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, " + \
diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py
index 2d36f4814..5f82b69b7 100644
--- a/pym/portage/sets/__init__.py
+++ b/pym/portage/sets/__init__.py
@@ -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]