summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-10-09 07:17:04 +0000
committerZac Medico <zmedico@gentoo.org>2009-10-09 07:17:04 +0000
commit42f16daade5ed09ed6b9fd01c139d840cdbff480 (patch)
tree2e879c7f5f48c02ca0ca1f885ad9eb968bfeab8a
parentBug #270933 - Make the "If you need support ..." message ask for emerge (diff)
downloadportage-42f16daade5ed09ed6b9fd01c139d840cdbff480.tar.gz
portage-42f16daade5ed09ed6b9fd01c139d840cdbff480.tar.bz2
portage-42f16daade5ed09ed6b9fd01c139d840cdbff480.zip
Bug #271551 - Inside depgraph.select_files(), avoid bailing out due to an
ambiguous package name in cases when all but one of the resolved packages are virtual. Thanks to Sebastian Mingramm (few) for this patch. svn path=/main/trunk/; revision=14522
-rw-r--r--pym/_emerge/depgraph.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index c384b5866..d015d9dc1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1570,6 +1570,18 @@ class depgraph(object):
expanded_atoms = [atom for atom in expanded_atoms \
if atom.cp == installed_cp]
+ # If a non-virtual package and one or more virtual packages
+ # are in expanded_atoms, use the non-virtual package.
+ if len(expanded_atoms) > 1:
+ number_of_virtuals = 0
+ for expanded_atom in expanded_atoms:
+ if expanded_atom.cp.startswith("virtual/"):
+ number_of_virtuals += 1
+ else:
+ candidate = expanded_atom
+ if len(expanded_atoms) - number_of_virtuals == 1:
+ expanded_atoms = [ candidate ]
+
if len(expanded_atoms) > 1:
print()
print()