From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RUljk-0004h5-6w for garchives@archives.gentoo.org; Sun, 27 Nov 2011 20:54:08 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1811821C10B; Sun, 27 Nov 2011 20:53:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id C569E21C10B for ; Sun, 27 Nov 2011 20:53:40 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 235301B400C for ; Sun, 27 Nov 2011 20:53:40 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 7CE8180044 for ; Sun, 27 Nov 2011 20:53:39 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/depgraph.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: ee441f2c5358656f2f404f65f8e4d4972ac6daf8 Date: Sun, 27 Nov 2011 20:53:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 611e758e-92d7-4b13-931a-e9ca39e16c60 X-Archives-Hash: 88f3de333a7fe545edef44adca1a5a2d commit: ee441f2c5358656f2f404f65f8e4d4972ac6daf8 Author: Zac Medico gentoo org> AuthorDate: Sun Nov 27 20:52:04 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Nov 27 20:52:04 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dee441f2c _get_dep_chain: fix KeyError, bug #392059 This fixes a regression since commit 57cc4e3e8991e7c4394d1dff7698aa62ed2a286b, which make a faulty assumption that the digraph contained all of the edges contained in parent_atoms. --- pym/_emerge/depgraph.py | 35 ++++++++++++++++++++++------------- 1 files changed, 22 insertions(+), 13 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 484206e..3bda894 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2743,6 +2743,7 @@ class depgraph(object): node =3D start_node child =3D None all_parents =3D self._dynamic_config._parent_atoms + graph =3D self._dynamic_config.digraph =20 if target_atom is not None and isinstance(node, Package): affecting_use =3D set() @@ -2801,8 +2802,12 @@ class depgraph(object): while node is not None: traversed_nodes.add(node) =20 - if isinstance(node, DependencyArg): - if self._dynamic_config.digraph.parent_nodes(node): + if node not in graph: + # The parent is not in the graph due to backtracking. + break + + elif isinstance(node, DependencyArg): + if graph.parent_nodes(node): node_type =3D "set" else: node_type =3D "argument" @@ -2815,13 +2820,21 @@ class depgraph(object): break =20 dep_strings =3D set() - for priority in self._dynamic_config.digraph.nodes[node][0][child]: - if priority.buildtime: - dep_strings.add(node.metadata["DEPEND"]) - if priority.runtime: - dep_strings.add(node.metadata["RDEPEND"]) - if priority.runtime_post: - dep_strings.add(node.metadata["PDEPEND"]) + priorities =3D graph.nodes[node][0].get(child) + if priorities is None: + # This edge comes from _parent_atoms and was not added to + # the graph, and _parent_atoms does not contain priorities. + dep_strings.add(node.metadata["DEPEND"]) + dep_strings.add(node.metadata["RDEPEND"]) + dep_strings.add(node.metadata["PDEPEND"]) + else: + for priority in priorities: + if priority.buildtime: + dep_strings.add(node.metadata["DEPEND"]) + if priority.runtime: + dep_strings.add(node.metadata["RDEPEND"]) + if priority.runtime_post: + dep_strings.add(node.metadata["PDEPEND"]) =20 affecting_use =3D set() for dep_str in dep_strings: @@ -2848,10 +2861,6 @@ class depgraph(object): =20 dep_chain.append((pkg_name, node.type_name)) =20 - if node not in self._dynamic_config.digraph: - # The parent is not in the graph due to backtracking. - break - # When traversing to parents, prefer arguments over packages # since arguments are root nodes. Never traverse the same # package twice, in order to prevent an infinite loop.