summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-09-14 08:24:30 +0000
committerZac Medico <zmedico@gentoo.org>2009-09-14 08:24:30 +0000
commit160e54481cfd26ac81c8bb1cb919656e52cc185c (patch)
tree88a8cadd940fa24546094accf1014687eecc7f09
parentbb160436634cf872fa25c592871e2f6da589ecf5 (diff)
downloadportage-160e54481cfd26ac81c8bb1cb919656e52cc185c.tar.gz
portage-160e54481cfd26ac81c8bb1cb919656e52cc185c.tar.bz2
portage-160e54481cfd26ac81c8bb1cb919656e52cc185c.zip
Simplify cpv_getkey() by just calling dep_getkey('=' + mycpv).
svn path=/main/trunk/; revision=14264
-rw-r--r--pym/portage/__init__.py17
-rw-r--r--pym/portage/dep.py1
2 files changed, 1 insertions, 17 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index adf306963..77288f7c0 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -7994,22 +7994,7 @@ def dep_wordreduce(mydeplist,mysettings,mydbapi,mode,use_cache=1):
return deplist
def cpv_getkey(mycpv):
- m = dep._cpv_re.search(mycpv)
- if m is not None and m.group(2) is not None:
- return m.group(2)
-
- # Fall back to legacy code for backward compatibility.
- myslash=mycpv.split("/")
- mysplit=pkgsplit(myslash[-1])
- if mysplit is None:
- return None
- mylen=len(myslash)
- if mylen==2:
- return myslash[0]+"/"+mysplit[0]
- elif mylen==1:
- return mysplit[0]
- else:
- return mysplit
+ return dep.dep_getkey('=' + mycpv)
def key_expand(mykey, mydb=None, use_cache=1, settings=None):
mysplit=mykey.split("/")
diff --git a/pym/portage/dep.py b/pym/portage/dep.py
index ae6d43ab5..b54c528fa 100644
--- a/pym/portage/dep.py
+++ b/pym/portage/dep.py
@@ -892,7 +892,6 @@ _use = r'(\[.*\])?'
_op = r'([=~]|[><]=?)'
_cp = '(' + _cat + '/' + _pkg + '(-' + _version + ')?)'
_cpv = '(' + _cp + '-' + _version + ')'
-_cpv_re = re.compile(_cpv)
_atom_re = re.compile('^(?:' +
'(?P<op>' + _op + _cpv + ')|' +