diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-02-13 19:28:07 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-02-13 19:28:07 -0800 |
commit | b4f98ec5a1eb2e010a455b19db5bef8d61def241 (patch) | |
tree | 91f4ed216ae5a050cccc76cd1aaa94aa1a90451e | |
parent | ec113fa7a8b9e8f13c4b4dfd110b10fe9a0c7cfc (diff) | |
download | portage-b4f98ec5a1eb2e010a455b19db5bef8d61def241.tar.gz portage-b4f98ec5a1eb2e010a455b19db5bef8d61def241.tar.bz2 portage-b4f98ec5a1eb2e010a455b19db5bef8d61def241.zip |
get_dep_chain: prefer parents in merge list
This will fix bug #354747.
-rw-r--r-- | pym/_emerge/depgraph.py | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 30e70462f..ef4d1f02d 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2359,20 +2359,20 @@ class depgraph(object): # 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. + child = node selected_parent = None + parent_arg = None + parent_merge = None + for parent in self._dynamic_config.digraph.parent_nodes(node): if parent in traversed_nodes: continue if isinstance(parent, DependencyArg): - if self._dynamic_config.digraph.parent_nodes(parent): - selected_parent = parent - child = node - else: - dep_chain.append( - (_unicode_decode("%s") % (parent,), "argument")) - selected_parent = None - break + parent_arg = parent else: + if isinstance(parent, Package) and \ + parent.operation == "merge": + parent_merge = parent if unsatisfied_dependency and node is start_node: # Make sure that pkg doesn't satisfy parent's dependency. # This ensures that we select the correct parent for use @@ -2382,11 +2382,21 @@ class depgraph(object): atom_set = InternalPackageSet(initial_atoms=(atom,)) if not atom_set.findAtomForPackage(start_node): selected_parent = parent - child = node break else: selected_parent = parent - child = node + + if parent_merge is not None: + # Prefer parent in the merge list (bug #354747). + selected_parent = parent_merge + elif parent_arg is not None: + if self._dynamic_config.digraph.parent_nodes(parent_arg): + selected_parent = parent_arg + else: + dep_chain.append( + (_unicode_decode("%s") % (parent,), "argument")) + selected_parent = None + node = selected_parent return dep_chain |