diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2024-06-02 22:18:05 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2024-06-02 22:18:05 +0300 |
commit | d37395418f44d5716a24d9cc84f8bf2d8bc084bb (patch) | |
tree | 7f1f80972060da29bcffdde7451d6f91a4438d5d /src | |
parent | mask: support comma separated bugs (diff) | |
download | pkgdev-d37395418f44d5716a24d9cc84f8bf2d8bc084bb.tar.gz pkgdev-d37395418f44d5716a24d9cc84f8bf2d8bc084bb.tar.bz2 pkgdev-d37395418f44d5716a24d9cc84f8bf2d8bc084bb.zip |
mask: fix test & improve error messages
Resolves: https://github.com/pkgcore/pkgdev/issues/188
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/pkgdev/scripts/pkgdev_mask.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pkgdev/scripts/pkgdev_mask.py b/src/pkgdev/scripts/pkgdev_mask.py index 1d614a0..450c52c 100644 --- a/src/pkgdev/scripts/pkgdev_mask.py +++ b/src/pkgdev/scripts/pkgdev_mask.py @@ -101,7 +101,12 @@ def _mask_validate(parser, namespace): atoms = set() maintainers = set() - namespace.bugs = list(map(int, dict.fromkeys(namespace.bugs))) + try: + namespace.bugs = list(map(int, dict.fromkeys(namespace.bugs))) + except ValueError: + parser.error("argument -b/--bug: invalid integer value") + if min(namespace.bugs, default=1) < 1: + parser.error("argument -b/--bug: must be >= 1") if not namespace.rites and namespace.file_bug: mask.error("bug filing requires last rites") |