diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2023-04-22 19:12:58 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2023-04-22 19:15:50 +0300 |
commit | ada871c510ab618493805b70ef0a1e054b5cbe8a (patch) | |
tree | 69d5284120a9e6604ce47df45aa457ff465c375c /src/pkgdev | |
parent | git: declare PKGDEV=1 env for git commands (diff) | |
download | pkgdev-ada871c510ab618493805b70ef0a1e054b5cbe8a.tar.gz pkgdev-ada871c510ab618493805b70ef0a1e054b5cbe8a.tar.bz2 pkgdev-ada871c510ab618493805b70ef0a1e054b5cbe8a.zip |
bugs: better error message when package not found
Resolves: https://github.com/pkgcore/pkgdev/issues/134
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'src/pkgdev')
-rw-r--r-- | src/pkgdev/scripts/pkgdev_bugs.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/pkgdev/scripts/pkgdev_bugs.py b/src/pkgdev/scripts/pkgdev_bugs.py index 173fce8..5b85e52 100644 --- a/src/pkgdev/scripts/pkgdev_bugs.py +++ b/src/pkgdev/scripts/pkgdev_bugs.py @@ -453,10 +453,18 @@ class DependencyGraph: node.file_bug(api_key, auto_cc_arches, observe) +def _parse_targets(search_repo, targets): + for _, target in targets: + try: + yield max(search_repo.itermatch(target)) + except ValueError: + raise ValueError(f"Restriction {target} has no match in repository") + + @bugs.bind_main_func def main(options, out: Formatter, err: Formatter): search_repo = options.search_repo - targets = [max(search_repo.itermatch(target)) for _, target in options.targets] + targets = list(_parse_targets(search_repo, options.targets)) d = DependencyGraph(out, err, options) d.build_full_graph(targets) d.merge_cycles() |