From 8b40fded4ca1ecc94ed1391acb3a7e16218d4779 Mon Sep 17 00:00:00 2001 From: Paul Varner Date: Tue, 16 Aug 2016 11:03:21 -0500 Subject: gentoolkit: Fix to allow a package name to end with a hyphen From PMS: "3.1.2 Package Names A package name may contain any of the characters [A-Za-z0-9+_-]. It must not begin with a hyphen or a plus sign, and must not end in a hyphen followed by anything matching the version syntax described in section 3.2." This fixes the validation in cpv.py to allow a package name to end with a hyphen as long as what follows does not match a version. X-Gentoo-bug: 586986 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=586986 --- pym/gentoolkit/cpv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pym/gentoolkit/cpv.py b/pym/gentoolkit/cpv.py index f1e3241..6e272f1 100644 --- a/pym/gentoolkit/cpv.py +++ b/pym/gentoolkit/cpv.py @@ -243,7 +243,7 @@ def isvalid_pkg_name(chunks): mf = _pkg_re.match if not all(not s or mf(s) for s in chunks): return False - if not chunks[-1] or (len(chunks) > 1 and chunks[-1].isdigit()): + if len(chunks) > 1 and chunks[-1].isdigit(): # not allowed. return False return True -- cgit v1.2.3