From 1a74ace5fbb231ea96ad5798d89bc8f59d73dac5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 31 Mar 2008 19:55:56 +0000 Subject: 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 --- pym/_emerge/__init__.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'pym') 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]) -- cgit v1.2.3-1-g7c22