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

src/script/build-with-container.py

index c8b65d13c4664585afab3e8e03f46c76fc1f2b5f..73c41213d29c9931cdfd543626430e76a990b3d1 100755 (executable)
@@ -719,12 +719,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():
@@ -941,6 +947,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",