]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
build-with-container.py: Add --rpmbuild-extra-args 64658/head
authorZack Cerza <zack@cerza.org>
Tue, 25 Feb 2025 16:15:32 +0000 (09:15 -0700)
committerDavid Galloway <david.galloway@ibm.com>
Thu, 24 Jul 2025 13:55:52 +0000 (09:55 -0400)
Signed-off-by: Zack Cerza <zack@cerza.org>
(cherry picked from commit fd75679cf4b93d3605a25af7a08e00be9aca48f6)

src/script/build-with-container.py

index ee3791170309c283b8bf8feaa6812f5dcc391168..54178e3acf77e16d91023a0aa5b5904095a26374 100755 (executable)
@@ -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",