From c9e0567c73557f1309cf219f1bd6d2fad1b34168 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Tue, 25 Feb 2025 09:15:32 -0700 Subject: [PATCH] build-with-container.py: Add --rpmbuild-extra-args Signed-off-by: Zack Cerza (cherry picked from commit fd75679cf4b93d3605a25af7a08e00be9aca48f6) --- src/script/build-with-container.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/script/build-with-container.py b/src/script/build-with-container.py index ee3791170309c..54178e3acf77e 100755 --- a/src/script/build-with-container.py +++ b/src/script/build-with-container.py @@ -651,12 +651,18 @@ def bc_build_rpm(ctx): topdir = ( pathlib.Path(ctx.cli.homedir) / ctx.cli.build_dir / "rpmbuild" ) + rpmbuild_args = [ + 'rpmbuild', + '--rebuild', + f'-D_topdir {topdir}', + ] + list(ctx.cli.rpmbuild_arg) + [str(srpm_path)] + rpmbuild_cmd = ' '.join(shlex.quote(cmd) for cmd in rpmbuild_args) cmd = _container_cmd( ctx, [ "bash", "-c", - f"set -x; mkdir -p {topdir} && rpmbuild --rebuild -D'_topdir {topdir}' {srpm_path}", + f"set -x; mkdir -p {topdir} && {rpmbuild_cmd}", ], ) with ctx.user_command(): @@ -870,6 +876,12 @@ def parse_cli(build_step_names): " git checkout. Use any source RPM available." ), ) + parser.add_argument( + "--rpmbuild-arg", + '-R', + action="append", + help="Pass this extra argument to rpmbuild", + ) parser.add_argument( "--ceph-version", help="Rather than infer the Ceph version, use this value", -- 2.39.5