summaryrefslogtreecommitdiffstats
path: root/pym/portage/versions.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-05-12 00:36:15 -0700
committerZac Medico <zmedico@gentoo.org>2012-05-12 00:36:15 -0700
commit68888b0450b1967cb70673a5f06b04c167ef879c (patch)
tree96b4dad5f20f5209aa5fd27c639481968c036337 /pym/portage/versions.py
parent76939c46aa2817bdbcea703432c52e5aa04160f9 (diff)
downloadportage-68888b0450b1967cb70673a5f06b04c167ef879c.tar.gz
portage-68888b0450b1967cb70673a5f06b04c167ef879c.tar.bz2
portage-68888b0450b1967cb70673a5f06b04c167ef879c.zip
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.
Diffstat (limited to 'pym/portage/versions.py')
-rw-r--r--pym/portage/versions.py8
1 files changed, 1 insertions, 7 deletions
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):