Skip to content

Commit ada871c

Browse files
committed
bugs: better error message when package not found
Resolves: #134 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent a339f3b commit ada871c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/pkgdev/scripts/pkgdev_bugs.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,18 @@ def observe(node: GraphNode):
453453
node.file_bug(api_key, auto_cc_arches, observe)
454454

455455

456+
def _parse_targets(search_repo, targets):
457+
for _, target in targets:
458+
try:
459+
yield max(search_repo.itermatch(target))
460+
except ValueError:
461+
raise ValueError(f"Restriction {target} has no match in repository")
462+
463+
456464
@bugs.bind_main_func
457465
def main(options, out: Formatter, err: Formatter):
458466
search_repo = options.search_repo
459-
targets = [max(search_repo.itermatch(target)) for _, target in options.targets]
467+
targets = list(_parse_targets(search_repo, options.targets))
460468
d = DependencyGraph(out, err, options)
461469
d.build_full_graph(targets)
462470
d.merge_cycles()

0 commit comments

Comments
 (0)