From: Zac Medico Date: Wed, 26 Sep 2012 04:11:31 +0000 (-0700) Subject: Use constants for more hardcoded *DEPEND lists. X-Git-Tag: v2.2.0_alpha133 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=886eee63bc0f4b56a6705d2ed671f361ed907f5f;p=portage.git Use constants for more hardcoded *DEPEND lists. --- 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"]