summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-10-18 00:10:51 +0000
committerZac Medico <zmedico@gentoo.org>2009-10-18 00:10:51 +0000
commitf16bc02a68287ca5ca67ca542f60e4e2af0c38fb (patch)
treecbfdc4751632fc7f22b6814602c73db3ad691e44
parentb79d97c1c9ecf237f26e77d3cded158603583ab6 (diff)
downloadportage-f16bc02a68287ca5ca67ca542f60e4e2af0c38fb.tar.gz
portage-f16bc02a68287ca5ca67ca542f60e4e2af0c38fb.tar.bz2
portage-f16bc02a68287ca5ca67ca542f60e4e2af0c38fb.zip
Make cpv_getkey() use catpkgsplit() insead of a separate regex.
svn path=/main/trunk/; revision=14628
-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 0e2499add..0ada1eb68 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -8309,12 +8309,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)