From 68888b0450b1967cb70673a5f06b04c167ef879c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 12 May 2012 00:36:15 -0700 Subject: catpkgsplit: don't cache results The cache has been subtly broken since commit eb2056631021a04b62c228206e44376f5c7a81ba when the eapi parameter was added. If necessary, we can add a cpv class (or something like that) in order to avoid redundant catpkgsplit calls in places like match_from_list. --- pym/portage/versions.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'pym/portage/versions.py') diff --git a/pym/portage/versions.py b/pym/portage/versions.py index 6cb15667e..e2761b53e 100644 --- a/pym/portage/versions.py +++ b/pym/portage/versions.py @@ -288,7 +288,7 @@ def _pkgsplit(mypkg, eapi=None): _cat_re = re.compile('^%s$' % _cat) _missing_cat = 'null' -catcache={} + def catpkgsplit(mydata, silent=1, eapi=None): """ Takes a Category/Package-Version-Rev and returns a list of each. @@ -304,10 +304,6 @@ def catpkgsplit(mydata, silent=1, eapi=None): 3. if rev does not exist it will be '-r0' """ - try: - return catcache[mydata] - except KeyError: - pass mysplit = mydata.split('/', 1) p_split=None if len(mysplit)==1: @@ -318,10 +314,8 @@ def catpkgsplit(mydata, silent=1, eapi=None): if _cat_re.match(cat) is not None: p_split = _pkgsplit(mysplit[1], eapi=eapi) if not p_split: - catcache[mydata]=None return None retval = (cat, p_split[0], p_split[1], p_split[2]) - catcache[mydata]=retval return retval def pkgsplit(mypkg, silent=1, eapi=None): -- cgit v1.2.3-1-g7c22