diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-05-30 06:50:34 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-05-30 06:50:34 +0000 |
commit | 98081528e5d412b6c8aaf5083c58ef816542907f (patch) | |
tree | e42d8d3255df1a2f181ec19c28f4854c3e6037e7 | |
parent | 3df5e08a6faaf14e1bfb0f7078922bd6be38eb0c (diff) | |
download | portage-98081528e5d412b6c8aaf5083c58ef816542907f.tar.gz portage-98081528e5d412b6c8aaf5083c58ef816542907f.tar.bz2 portage-98081528e5d412b6c8aaf5083c58ef816542907f.zip |
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
-rw-r--r-- | pym/portage/sets/base.py | 6 |
1 files changed, 3 insertions, 3 deletions
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): """ |