From 886eee63bc0f4b56a6705d2ed671f361ed907f5f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 25 Sep 2012 21:11:31 -0700 Subject: [PATCH] Use constants for more hardcoded *DEPEND lists. --- pym/_emerge/depgraph.py | 10 ++++------ pym/_emerge/resolver/circular_dependency.py | 5 +++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 1588f2c5e..b4c799eb6 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -3187,15 +3187,13 @@ class depgraph(object): 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"]) - dep_strings.add(node.metadata["HDEPEND"]) + for k in Package._dep_keys: + dep_strings.add(node.metadata[k]) else: for priority in priorities: if priority.buildtime: - dep_strings.add(node.metadata["DEPEND"]) - dep_strings.add(node.metadata["HDEPEND"]) + for k in Package._buildtime_keys: + dep_strings.add(node.metadata[k]) if priority.runtime: dep_strings.add(node.metadata["RDEPEND"]) if priority.runtime_post: diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py index d60f1850d..5192d61e9 100644 --- a/pym/_emerge/resolver/circular_dependency.py +++ b/pym/_emerge/resolver/circular_dependency.py @@ -11,6 +11,7 @@ from portage.exception import InvalidDependString from portage.output import colorize from portage.util import writemsg_level from _emerge.DepPrioritySatisfiedRange import DepPrioritySatisfiedRange +from _emerge.Package import Package class circular_dependency_handler(object): @@ -113,8 +114,8 @@ class circular_dependency_handler(object): parent_atoms = self.all_parent_atoms.get(pkg) if priorities[-1].buildtime: - dep = parent.metadata["DEPEND"] + \ - " " + parent.metadata["HDEPEND"] + dep = " ".join(parent.metadata[k] + for k in Package._buildtime_keys) elif priorities[-1].runtime: dep = parent.metadata["RDEPEND"] -- 2.26.2