From: "Paul Varner" <fuzzyray@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/
Date: Thu, 22 Oct 2015 16:13:59 +0000 (UTC) [thread overview]
Message-ID: <1445530170.1537ab55fffda2348753ce26d6d7c11de49d9032.fuzzyray@gentoo> (raw)
commit: 1537ab55fffda2348753ce26d6d7c11de49d9032
Author: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 22 16:09:30 2015 +0000
Commit: Paul Varner <fuzzyray <AT> gentoo <DOT> 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)
next reply other threads:[~2015-10-22 16:14 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-22 16:13 Paul Varner [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-07-08 15:37 [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ Brian Dolbec
2016-07-25 18:04 Paul Varner
2016-08-16 16:05 Paul Varner
2016-09-15 16:02 Brian Dolbec
2017-09-06 18:33 Paul Varner
2018-09-17 23:32 Virgil Dupras
2019-05-11 22:43 Virgil Dupras
2019-07-29 0:51 Zac Medico
2020-04-24 8:06 Michał Górny
2020-10-09 6:29 Georgy Yakovlev
2020-10-13 14:14 Brian Dolbec
2021-09-21 21:01 Matt Turner
2022-07-10 7:53 Brian Dolbec
2022-07-10 7:53 Brian Dolbec
2022-12-14 9:24 Sam James
2024-02-16 20:39 Sam James
2024-02-16 20:39 Sam James
2024-02-16 20:39 Sam James
2024-02-17 0:01 Sam James
2024-03-07 15:08 Sam James
2024-03-07 18:49 Sam James
2024-05-03 5:55 Sam James
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1445530170.1537ab55fffda2348753ce26d6d7c11de49d9032.fuzzyray@gentoo \
--to=fuzzyray@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox