aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2023-06-22 19:16:09 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2023-06-22 19:16:09 +0300
commitd8f4c5c7b198d6ad0dc6bfe88163b5ae0cff2b48 (patch)
treece4cc16c02fabd8034a96d5e257fafc6cdc0b446
parentbugs: improve output texts (diff)
downloadpkgdev-d8f4c5c7b198d6ad0dc6bfe88163b5ae0cff2b48.tar.gz
pkgdev-d8f4c5c7b198d6ad0dc6bfe88163b5ae0cff2b48.tar.bz2
pkgdev-d8f4c5c7b198d6ad0dc6bfe88163b5ae0cff2b48.zip
bugs: fix bugs to open count
Resolves: https://github.com/pkgcore/pkgdev/issues/142 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--src/pkgdev/scripts/pkgdev_bugs.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pkgdev/scripts/pkgdev_bugs.py b/src/pkgdev/scripts/pkgdev_bugs.py
index 0a3ff91..08da876 100644
--- a/src/pkgdev/scripts/pkgdev_bugs.py
+++ b/src/pkgdev/scripts/pkgdev_bugs.py
@@ -525,8 +525,13 @@ def main(options, out: Formatter, err: Formatter):
d.output_dot(options.dot)
out.write(out.fg("green"), f"Dot file written to {options.dot}", out.reset)
+ bugs_count = len(tuple(node for node in d.nodes if node.bugno is None))
+ if bugs_count == 0:
+ out.write(out.fg("red"), "Nothing to do, exiting", out.reset)
+ return 1
+
if not userquery(
- f"Continue and create {len(d.nodes)} stablereq bugs?", out, err, default_answer=False
+ f"Continue and create {bugs_count} stablereq bugs?", out, err, default_answer=False
):
return 1