Use constants for more hardcoded *DEPEND lists. v2.2.0_alpha133
authorZac Medico <zmedico@gentoo.org>
Wed, 26 Sep 2012 04:11:31 +0000 (21:11 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 26 Sep 2012 04:11:31 +0000 (21:11 -0700)
pym/_emerge/depgraph.py
pym/_emerge/resolver/circular_dependency.py

index 1588f2c5edc590a1cb65279ce34da3357c6aa211..b4c799eb64a77a38cc1e506f9947fb6679ee4126 100644 (file)
@@ -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:
index d60f1850d6c5829ebdc6048219cfa83cdf694eb7..5192d61e99c41b0056ae7026f3df8b9acddca6d5 100644 (file)
@@ -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"]