diff options
-rw-r--r-- | src/pkgcore/ebuild/cpv.py | 7 | ||||
-rw-r--r-- | tests/ebuild/test_cpv.py | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/pkgcore/ebuild/cpv.py b/src/pkgcore/ebuild/cpv.py index b7149fc1e..39a0339ed 100644 --- a/src/pkgcore/ebuild/cpv.py +++ b/src/pkgcore/ebuild/cpv.py @@ -42,7 +42,12 @@ def isvalid_pkg_name(chunks): # chunk, i.e. at least one hyphen if len(chunks) == 1: return True - return not (isvalid_version_re.match(chunks[-1]) or isvalid_rev(chunks[-1])) + if isvalid_version_re.match(chunks[-1]): + return False + if len(chunks) >= 3 and isvalid_rev(chunks[-1]): + # if the last chunk is a revision, the proceeding *must not* be version like. + return not isvalid_version_re.match(chunks[-2]) + return True def isvalid_rev(s: str): diff --git a/tests/ebuild/test_cpv.py b/tests/ebuild/test_cpv.py index 1a778a936..ae7d80260 100644 --- a/tests/ebuild/test_cpv.py +++ b/tests/ebuild/test_cpv.py @@ -64,6 +64,7 @@ class TestCPV: "bah/f-100dpi", "dev-util/diffball-blah-monkeys", "virtual/7z", + "x11-drivers/xf86-video-r128", ) good_vers = ("1", "2.3.4", "2.3.4a", "02.3", "2.03", "3d", "3D") |