From 7cd048c2ee21935312c3b05c9b128c183b4e6ad8 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Thu, 8 May 2025 13:22:52 -0400 Subject: [PATCH] script/build-with-container: handle failure to find source rpm better Don't use an obscure assert, raise an exception with a helpful error message. Signed-off-by: John Mulligan --- src/script/build-with-container.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/script/build-with-container.py b/src/script/build-with-container.py index 0f925f1234adc..33e53e82f7644 100755 --- a/src/script/build-with-container.py +++ b/src/script/build-with-container.py @@ -717,7 +717,10 @@ def bc_build_rpm(ctx): # no matches. build a new srpm ctx.build.wants(Steps.SOURCE_RPM, ctx) paths = _glob_search(ctx, srpm_glob) - assert paths + if not paths: + raise RuntimeError( + f"unable to find source rpm(s) matching {srpm_glob}" + ) srpm_path = pathlib.Path(ctx.cli.homedir) / paths[0] topdir = pathlib.Path(ctx.cli.homedir) / "rpmbuild" if ctx.cli.build_dir: -- 2.39.5