summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-10-18 03:58:44 +0000
committerZac Medico <zmedico@gentoo.org>2009-10-18 03:58:44 +0000
commitfa38149bce67c93e52701fbd8f2adca9d26db01c (patch)
treec3f34188aad4f7fa882cc1605afa1dbee6ed5787 /pym
parent6714ea6be40055e7f543ac714db4efddd80871d2 (diff)
downloadportage-fa38149bce67c93e52701fbd8f2adca9d26db01c.tar.gz
portage-fa38149bce67c93e52701fbd8f2adca9d26db01c.tar.bz2
portage-fa38149bce67c93e52701fbd8f2adca9d26db01c.zip
Make cpv_getkey() use catpkgsplit() insead of a separate regex. (trunk r14628)
svn path=/main/branches/2.1.7/; revision=14656
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 1b50b4cbb..ec6f5b96e 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -8306,12 +8306,11 @@ def dep_wordreduce(mydeplist,mysettings,mydbapi,mode,use_cache=1):
return None
return deplist
-_cpv_key_re = re.compile('^' + versions._cpv + '$', re.VERBOSE)
def cpv_getkey(mycpv):
"""Calls pkgsplit on a cpv and returns only the cp."""
- m = _cpv_key_re.match(mycpv)
- if m is not None:
- return m.group(2)
+ mysplit = versions.catpkgsplit(mycpv)
+ if mysplit is not None:
+ return mysplit[0] + '/' + mysplit[1]
warnings.warn("portage.cpv_getkey() called with invalid cpv: '%s'" \
% (mycpv,), DeprecationWarning)