summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-02-05 23:02:36 +0000
committerZac Medico <zmedico@gentoo.org>2009-02-05 23:02:36 +0000
commitce13d46f56fe0ddd79ee58e14821c92b916c32c3 (patch)
tree620559191be888ad61b0e59cc9946b886ba05ece
parentd9e6cbebc52c64d8b5c87442adc114ce0fe5243c (diff)
downloadportage-ce13d46f56fe0ddd79ee58e14821c92b916c32c3.tar.gz
portage-ce13d46f56fe0ddd79ee58e14821c92b916c32c3.tar.bz2
portage-ce13d46f56fe0ddd79ee58e14821c92b916c32c3.zip
Fix digraph.clone() to properly clone priority lists.
svn path=/main/trunk/; revision=12587
-rw-r--r--pym/portage/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 85c970440..5ac305817 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -561,8 +561,14 @@ class digraph(object):
def clone(self):
clone = digraph()
clone.nodes = {}
- for k, v in self.nodes.iteritems():
- clone.nodes[k] = (v[0].copy(), v[1].copy(), v[2])
+ for children, parents, node in self.nodes.itervalues():
+ children_clone = {}
+ for child, priorities in children.iteritems():
+ children_clone[child] = priorities[:]
+ parents_clone = {}
+ for parent, priorities in parents.iteritems():
+ parents_clone[parent] = priorities[:]
+ clone.nodes[node] = (children_clone, parents_clone, node)
clone.order = self.order[:]
return clone