Iterate over a copy of the digraph nodes so that removal can't break
authorZac Medico <zmedico@gentoo.org>
Thu, 10 Apr 2008 09:11:56 +0000 (09:11 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 10 Apr 2008 09:11:56 +0000 (09:11 -0000)
the iterator. (trunk r9799)

svn path=/main/branches/2.1.2/; revision=9800

bin/emerge

index 6e97d545659f5629ecd710ee36fee388e9a2a4c4..575a03d5312dac12b795ac7a75144bffc98e0691 100755 (executable)
@@ -7144,7 +7144,7 @@ def action_build(settings, trees, mtimedb,
                                return retval
                        if "--buildpkgonly" in myopts:
                                graph_copy = mydepgraph.digraph.clone()
-                               for node in graph_copy.order:
+                               for node in list(graph_copy.order):
                                        if not isinstance(node, Package):
                                                graph_copy.remove(node)
                                if not graph_copy.hasallzeros(ignore_priority=DepPriority.MEDIUM):
@@ -7154,7 +7154,7 @@ def action_build(settings, trees, mtimedb,
        else:
                if "--buildpkgonly" in myopts:
                        graph_copy = mydepgraph.digraph.clone()
-                       for node in graph_copy.order:
+                       for node in list(graph_copy.order):
                                if not isinstance(node, Package):
                                        graph_copy.remove(node)
                        if not graph_copy.hasallzeros(ignore_priority=DepPriority.MEDIUM):