From 171b14705448090e9fd652db1a65e4da7bf4e876 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Wed, 12 Aug 2026 17:45:24 +0200 Subject: [PATCH] Now exits with 1 when a build produced no packages The container exiting zero was taken as success, even with an empty output directory. A build that produces nothing has failed, and a caller checking only the exit code had no way to tell. A failing container already exited non-zero. This covers the case where it claims success but leaves nothing behind. Signed-off-by: Lars Erik Wik --- build-in-container.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/build-in-container.py b/build-in-container.py index c5e8523c9..8f49bd6e5 100755 --- a/build-in-container.py +++ b/build-in-container.py @@ -704,12 +704,13 @@ def main(): + list(output_dir.glob("*.msi")) + list(output_dir.glob("*.tar.gz")) ) - if packages: - log.info("Output packages:") - for p in sorted(packages): - log.info(f" {p}") - else: - log.warning("No packages found in output directory.") + if not packages: + log.error(f"Build produced nothing in {output_dir}.") + sys.exit(1) + + log.info("Output packages:") + for p in sorted(packages): + log.info(f" {p}") if __name__ == "__main__":