From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4472013888F for ; Thu, 22 Oct 2015 16:14:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 78ADEE083B; Thu, 22 Oct 2015 16:14:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 26B6DE083B for ; Thu, 22 Oct 2015 16:14:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0AED3340A12 for ; Thu, 22 Oct 2015 16:14:02 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C3149DFB for ; Thu, 22 Oct 2015 16:13:59 +0000 (UTC) From: "Paul Varner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Paul Varner" Message-ID: <1445530170.1537ab55fffda2348753ce26d6d7c11de49d9032.fuzzyray@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/cpv.py pym/gentoolkit/query.py X-VCS-Directories: pym/gentoolkit/ X-VCS-Committer: fuzzyray X-VCS-Committer-Name: Paul Varner X-VCS-Revision: 1537ab55fffda2348753ce26d6d7c11de49d9032 X-VCS-Branch: master Date: Thu, 22 Oct 2015 16:13:59 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 9a6552a8-772c-4a7a-804a-c0eaeb5b047e X-Archives-Hash: 884108280a00be8c0123bea136ab5149 commit: 1537ab55fffda2348753ce26d6d7c11de49d9032 Author: Paul Varner gentoo org> AuthorDate: Thu Oct 22 16:09:30 2015 +0000 Commit: Paul Varner gentoo org> CommitDate: Thu Oct 22 16:09:30 2015 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=1537ab55 gentoolkit: Fix to allow package names of all digits. Bug 562952 According to PMS, "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". This specification means that a package name can be composed of all digits. This fixes cpv.py and query.py to allow package names of all digits. pym/gentoolkit/cpv.py | 2 +- pym/gentoolkit/query.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pym/gentoolkit/cpv.py b/pym/gentoolkit/cpv.py index 473ae60..f1e3241 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 chunks[-1].isdigit() or not chunks[-1]: + if not chunks[-1] or (len(chunks) > 1 and chunks[-1].isdigit()): # not allowed. return False return True diff --git a/pym/gentoolkit/query.py b/pym/gentoolkit/query.py index df6e2fd..9d1a313 100644 --- a/pym/gentoolkit/query.py +++ b/pym/gentoolkit/query.py @@ -19,7 +19,7 @@ __all__ = ( import fnmatch import re from functools import partial -from string import ascii_letters +from string import ascii_letters, digits import portage @@ -47,7 +47,7 @@ class Query(CPV): """ # We need at least one of these chars for a valid query - needed_chars = ascii_letters + '*' + needed_chars = ascii_letters + digits + '*' if not set(query).intersection(needed_chars): raise errors.GentoolkitInvalidPackage(query)