svn path=/main/trunk/; revision=5251
return operator
+_dep_getcpv_cache = {}
+
def dep_getcpv(mydep):
"""
Return the category-package-version with any operators/slot specifications stripped off
@rtype: String
@return: The depstring with the operator removed
"""
+ global _dep_getcpv_cache
+ retval = _dep_getcpv_cache.get(mydep, None)
+ if retval is not None:
+ return retval
+ mydep_orig = mydep
if mydep and mydep[0] == "*":
mydep = mydep[1:]
if mydep and mydep[-1] == "*":
mydep = mydep[1:]
colon = mydep.rfind(":")
if colon != -1:
- return mydep[:colon]
+ mydep = mydep[:colon]
+ _dep_getcpv_cache[mydep_orig] = mydep
return mydep
def dep_getslot(mydep):