commit:     611a1c75c42457c619bc526620eda77aae00d41d
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  5 06:36:37 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Wed Mar  5 06:40:03 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgdev.git/commit/?id=611a1c75

tatt: explain why no jobs are being created (-u 0 -t)

This can happen if "-u 0 -t" is passed to tatt, but the package
defines no src_test phase. In this case, the tatt script will
generate no jobs and the user is bewildered as to why.

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgdev/scripts/pkgdev_tatt.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/pkgdev/scripts/pkgdev_tatt.py 
b/src/pkgdev/scripts/pkgdev_tatt.py
index 65e3392..75e50cf 100644
--- a/src/pkgdev/scripts/pkgdev_tatt.py
+++ b/src/pkgdev/scripts/pkgdev_tatt.py
@@ -384,6 +384,12 @@ def main(options, out, err):
 
     from jinja2 import Template
 
+    if not any("test" in pkg.defined_phases for pkg in pkgs):
+        if not options.use_combos > 0:
+            return err.error(
+                "no packages define a src_test, and --use-combos is not a 
positive integer. Cannot create any jobs, exiting..."
+            )
+
     script = Template(template, trim_blocks=True, lstrip_blocks=True).render(
         jobs=list(_build_jobs(options, pkgs)),
         report_file=job_name + ".report",

Reply via email to