Add discover
Some checks failed
nightly-build / discover (push) Successful in 2m42s
nightly-build / build (push) Failing after 57s

This commit is contained in:
KenwoodFox
2026-06-28 23:23:53 -04:00
parent 56aab1536d
commit 7c16ba2636
2 changed files with 47 additions and 3 deletions

View File

@@ -19,6 +19,7 @@ from __future__ import annotations
import argparse
import base64
import json
import os
import shlex
import shutil
@@ -355,6 +356,9 @@ def main(argv: List[str]) -> int:
help="Scratch directory for clones/builds")
ap.add_argument("--only", nargs="*", default=[],
help="Only build these package directory names")
ap.add_argument("--list-json", action="store_true",
help="Print discovered package names as a JSON array and exit "
"(used to build the CI matrix)")
ap.add_argument("--cleanbuild", action="store_true",
help="Pass --cleanbuild to makepkg")
ap.add_argument("--sign", action="store_true",
@@ -388,6 +392,11 @@ def main(argv: List[str]) -> int:
args = ap.parse_args(argv)
cfg = build_config(args)
if args.list_json:
pkgs = discover_packages(cfg, args.only)
print(json.dumps([p.name for p in pkgs]))
return 0
pkgs = discover_packages(cfg, args.only)
if not pkgs:
print("No package directories found.", file=sys.stderr)