Skip to content

Commit e21d247

Browse files
committed
run.py: add --rpmbuild-opts to help use "rpmbuild --without xxx" etc
Signed-off-by: Yann Dirson <[email protected]>
1 parent a2ed8c9 commit e21d247

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

files/init-container.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ if [ -n "$BUILD_LOCAL" ]; then
7373
RPMBUILDFLAGS=(
7474
-ba SPECS/*.spec
7575
--target "$RPMARCH"
76+
$RPMBUILD_OPTS
7677
)
7778
# in case the build deps contain xs-opam-repo, source the added profile.d file
7879
[ ! -f /etc/profile.d/opam.sh ] || source /etc/profile.d/opam.sh

run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def main():
5353
help="Definitions to be passed to rpmbuild (if --build-local is "
5454
"passed too). Example: --define 'xcp_ng_section extras', for building the 'extras' "
5555
"version of a package which exists in both 'base' and 'extras' versions.")
56+
parser.add_argument('--rpmbuild-opts', action='append',
57+
help="Pass additional option(s) to rpmbuild")
5658
parser.add_argument('-o', '--output-dir',
5759
help="Output directory for --build-local.")
5860
parser.add_argument('-n', '--no-exit', action='store_true',
@@ -111,6 +113,8 @@ def main():
111113
docker_args += ["-e", "BUILD_LOCAL=1"]
112114
if args.define:
113115
docker_args += ["-e", "RPMBUILD_DEFINE=%s" % args.define]
116+
if args.rpmbuild_opts:
117+
docker_args += ["-e", "RPMBUILD_OPTS=%s" % ' '.join(args.rpmbuild_opts)]
114118
if args.output_dir:
115119
if not os.path.isdir(args.output_dir):
116120
parser.error("%s is not a valid output directory." %

0 commit comments

Comments
 (0)