summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-07-28 16:02:46 -0700
committerZac Medico <zmedico@gentoo.org>2013-07-28 16:02:46 -0700
commit6175b127b82dc2c777c7d134085457946d1e36e5 (patch)
tree01b1689a5b459d22b858c63147afa3f20596be28
parentrepoman: export GPG_TTY for bug #477728 (diff)
downloadportage-6175b127b82dc2c777c7d134085457946d1e36e5.tar.gz
portage-6175b127b82dc2c777c7d134085457946d1e36e5.tar.bz2
portage-6175b127b82dc2c777c7d134085457946d1e36e5.zip
depgraph: avoid conflicts during _complete_graph
During _complete_graph, it was possible for _select_pkg_from_graph to make some poor package selections that would result in conflicts when there were two matches in different slots that conflicted with eachother.
-rw-r--r--pym/_emerge/depgraph.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 939adde49..a7316f018 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5084,9 +5084,16 @@ class depgraph(object):
matches = graph_db.match_pkgs(atom)
if not matches:
return None, None
- pkg = matches[-1] # highest match
- in_graph = self._dynamic_config._slot_pkg_map[root].get(pkg.slot_atom)
- return pkg, in_graph
+
+ # There may be multiple matches, and they may
+ # conflict with eachother, so choose the highest
+ # version that has already been added to the graph.
+ for pkg in reversed(matches):
+ if pkg in self._dynamic_config.digraph:
+ return pkg, pkg
+
+ # Fall back to installed packages
+ return self._select_pkg_from_installed(root, atom, onlydeps=onlydeps)
def _select_pkg_from_installed(self, root, atom, onlydeps=False):
"""