diff options
-rw-r--r-- | pym/portage/__init__.py | 5 | ||||
-rw-r--r-- | pym/portage/dep.py | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index c842f27e3..adf306963 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -7994,6 +7994,11 @@ 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: diff --git a/pym/portage/dep.py b/pym/portage/dep.py index 929e31dbe..12e26ab87 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -895,6 +895,7 @@ _use = r'(\[.*\])?' _op = r'([=~]|[><]=?)' _cp = '(' + _cat + '/' + _pkg + '(-' + _version + ')?)' _cpv = '(' + _cp + '-' + _version + ')' +_cpv_re = re.compile(_cpv) _atom_re = re.compile('^(?:' + '(?P<op>' + _op + _cpv + ')|' + |