From: John Mulligan Date: Thu, 8 May 2025 15:21:32 +0000 (-0400) Subject: script/build-with-container: fix rpm build step when using an overlay X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=acebfed03cacdef8735c37f68fc1f415b934f68a;p=ceph.git script/build-with-container: fix rpm build step when using an overlay Signed-off-by: John Mulligan --- diff --git a/src/script/build-with-container.py b/src/script/build-with-container.py index 270f0a20558ff..0f925f1234adc 100755 --- a/src/script/build-with-container.py +++ b/src/script/build-with-container.py @@ -681,6 +681,11 @@ def bc_make_source_rpm(ctx): _run(cmd, check=True, ctx=ctx) +def _glob_search(ctx, pattern): + overlay = ctx.overlay() + return glob.glob(pattern, root_dir=overlay.upper if overlay else None) + + @Builder.set(Steps.RPM) def bc_build_rpm(ctx): """Build RPMs from SRPM.""" @@ -701,7 +706,7 @@ def bc_build_rpm(ctx): ctx.cli.ceph_version ) srpm_glob = f"ceph-{srpm_version}.*.src.rpm" - paths = glob.glob(srpm_glob) + paths = _glob_search(ctx, srpm_glob) if len(paths) > 1: raise RuntimeError( "too many matching source rpms" @@ -711,7 +716,7 @@ def bc_build_rpm(ctx): if not paths: # no matches. build a new srpm ctx.build.wants(Steps.SOURCE_RPM, ctx) - paths = glob.glob(srpm_glob) + paths = _glob_search(ctx, srpm_glob) assert paths srpm_path = pathlib.Path(ctx.cli.homedir) / paths[0] topdir = pathlib.Path(ctx.cli.homedir) / "rpmbuild"