summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-03-31 19:55:56 +0000
committerZac Medico <zmedico@gentoo.org>2008-03-31 19:55:56 +0000
commit1a74ace5fbb231ea96ad5798d89bc8f59d73dac5 (patch)
treef2ce99d191af8d1f400e81098af0437aa59cf3d6 /pym
parent7464177498aa9d43280f8f4f40fc8bd1fffe5e02 (diff)
downloadportage-1a74ace5fbb231ea96ad5798d89bc8f59d73dac5.tar.gz
portage-1a74ace5fbb231ea96ad5798d89bc8f59d73dac5.tar.bz2
portage-1a74ace5fbb231ea96ad5798d89bc8f59d73dac5.zip
When selecting packages and there is a mixture of old-style and new-style
virtual matches, filter out the old-style virtual matches. svn path=/main/trunk/; revision=9648
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/__init__.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 60cb96e1d..848e0e893 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -1190,7 +1190,7 @@ def iter_atoms(deps):
class Package(object):
__slots__ = ("__weakref__", "built", "cpv", "depth",
"installed", "metadata", "root", "onlydeps", "type_name",
- "cpv_slot", "slot_atom", "_digraph_node")
+ "cp", "cpv_slot", "slot_atom", "_digraph_node")
def __init__(self, **kwargs):
for myattr in self.__slots__:
if myattr == "__weakref__":
@@ -1198,9 +1198,8 @@ class Package(object):
myvalue = kwargs.get(myattr, None)
setattr(self, myattr, myvalue)
- self.slot_atom = "%s:%s" % \
- (portage.cpv_getkey(self.cpv), self.metadata["SLOT"])
-
+ self.cp = portage.cpv_getkey(self.cpv)
+ self.slot_atom = "%s:%s" % (self.cp, self.metadata["SLOT"])
self.cpv_slot = "%s:%s" % (self.cpv, self.metadata["SLOT"])
status = "merge"
@@ -2743,6 +2742,20 @@ class depgraph(object):
for pkg in matched_packages:
print (pkg.type_name + ":").rjust(10), pkg.cpv
+ # Filter out any old-style virtual matches if they are
+ # mixed with new-style virtual matches.
+ cp = portage.dep_getkey(atom)
+ if len(matched_packages) > 1 and \
+ "virtual" == portage.catsplit(cp)[0]:
+ for pkg in matched_packages:
+ if pkg.cp != cp:
+ continue
+ # Got a new-style virtual, so filter
+ # out any old-style virtuals.
+ matched_packages = [pkg for pkg in matched_packages \
+ if pkg.cp == cp]
+ break
+
if len(matched_packages) > 1:
bestmatch = portage.best(
[pkg.cpv for pkg in matched_packages])