From: Zac Medico Date: Fri, 30 May 2008 06:50:34 +0000 (-0000) Subject: Make PackageSet.findAtomForPackage() just return the first atom found X-Git-Tag: v2.2_pre8~63 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=98081528e5d412b6c8aaf5083c58ef816542907f;p=portage.git Make PackageSet.findAtomForPackage() just return the first atom found since best_match_to_list() won't work correctly for atoms matched via PROVIDE. svn path=/main/trunk/; revision=10501 --- diff --git a/pym/portage/sets/base.py b/pym/portage/sets/base.py index 3f85965bc..2ae4723fb 100644 --- a/pym/portage/sets/base.py +++ b/pym/portage/sets/base.py @@ -105,10 +105,10 @@ class PackageSet(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 best_match_to_list(pkg, atoms) def iterAtomsForPackage(self, pkg): """