_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.
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:
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):