Add discover
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user