Make PackageSet.findAtomForPackage() just return the first atom found
authorZac Medico <zmedico@gentoo.org>
Fri, 30 May 2008 06:56:40 +0000 (06:56 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 30 May 2008 06:56:40 +0000 (06:56 -0000)
since best_match_to_list() won't work correctly for atoms matched
via PROVIDE. (trunk r10501)

svn path=/main/branches/2.1.2/; revision=10502

bin/emerge

index a232565c51ff163edbd159258d08db4c35258c82..d4321c28211a4b951efaf63831a0c976a89a0ccc 100755 (executable)
@@ -818,10 +818,10 @@ class InternalPackageSet(object):
                None if there are no matches.  This matches virtual arguments against
                the PROVIDE metadata.  This can raise an InvalidDependString exception
                if an error occurs while parsing PROVIDE."""
-               atoms = list(self.iterAtomsForPackage(pkg))
-               if not atoms:
+               try:
+                       return self.iterAtomsForPackage(pkg).next()
+               except StopIteration:
                        return None
-               return portage.best_match_to_list(pkg, atoms)
 
        def iterAtomsForPackage(self, pkg):
                """