Skip to content

Commit fd75679

Browse files
committed
build-with-container.py: Add --rpmbuild-extra-args
Signed-off-by: Zack Cerza <[email protected]>
1 parent a5a983c commit fd75679

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/script/build-with-container.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,12 +636,18 @@ def bc_build_rpm(ctx):
636636
topdir = (
637637
pathlib.Path(ctx.cli.homedir) / ctx.cli.build_dir / "rpmbuild"
638638
)
639+
rpmbuild_args = [
640+
'rpmbuild',
641+
'--rebuild',
642+
f'-D_topdir {topdir}',
643+
] + list(ctx.cli.rpmbuild_arg) + [str(srpm_path)]
644+
rpmbuild_cmd = ' '.join(shlex.quote(cmd) for cmd in rpmbuild_args)
639645
cmd = _container_cmd(
640646
ctx,
641647
[
642648
"bash",
643649
"-c",
644-
f"set -x; mkdir -p {topdir} && rpmbuild --rebuild -D'_topdir {topdir}' {srpm_path}",
650+
f"set -x; mkdir -p {topdir} && {rpmbuild_cmd}",
645651
],
646652
)
647653
with ctx.user_command():
@@ -855,6 +861,12 @@ def parse_cli(build_step_names):
855861
" git checkout. Use any source RPM available."
856862
),
857863
)
864+
parser.add_argument(
865+
"--rpmbuild-arg",
866+
'-R',
867+
action="append",
868+
help="Pass this extra argument to rpmbuild",
869+
)
858870
parser.add_argument(
859871
"--ceph-version",
860872
help="Rather than infer the Ceph version, use this value",

0 commit comments

Comments
 (0)