bestm = x
return bestm
+_match_from_list_cache = {}
+
def match_from_list(mydep, candidate_list):
"""
Searches list for entries that matches the package.
@return: A list of package atoms that match the given package atom
"""
+ global _match_from_list_cache
+ mylist = _match_from_list_cache.get((mydep, tuple(candidate_list)), None)
+ if mylist is not None:
+ return mylist[:]
+
from portage_util import writemsg
if mydep[0] == "!":
mydep = mydep[1:]
else:
raise KeyError("Unknown operator: %s" % mydep)
+ _match_from_list_cache[(mydep, tuple(candidate_list))] = mylist
return mylist