Skip to content

Commit f82d2f9

Browse files
committed
run.sh: --rpmbuild-stage to override "-ba"
Notably useful for -bp, to - quickly get a patched source tree - apply patches using quilt, in order to refresh them in 8.3 env, so they will not be rejected by the 9.0 one Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
1 parent d623a26 commit f82d2f9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

files/init-container.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ if [ -n "$BUILD_LOCAL" ]; then
8686
esac
8787

8888
sudo $BDEP "${SPECFLAGS[@]}" -y $specs
89+
90+
: ${RPMBUILD_STAGE:=a} # default if not specified: -ba
8991
RPMBUILDFLAGS=(
90-
-ba $specs
92+
-b${RPMBUILD_STAGE} $specs
9193
--target "$RPMARCH"
9294
$RPMBUILD_OPTS
9395
"${SPECFLAGS[@]}"

run.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
DEFAULT_BRANCH = '8.3'
2020
DEFAULT_ULIMIT_NOFILE = 2048
21+
RPMBUILD_STAGES = "abpfcilsrd" # valid X values in `rpmbuild -bX`
2122

2223
RUNNER = os.getenv("XCPNG_OCI_RUNNER")
2324
if RUNNER is None:
@@ -55,6 +56,8 @@ def main():
5556
"version of a package which exists in both 'base' and 'extras' versions.")
5657
parser.add_argument('--rpmbuild-opts', action='append',
5758
help="Pass additional option(s) to rpmbuild")
59+
parser.add_argument('--rpmbuild-stage', action='store',
60+
help=f"Request given -bX stage rpmbuild, X in [{RPMBUILD_STAGES}]")
5861
parser.add_argument('-o', '--output-dir',
5962
help="Output directory for --build-local.")
6063
parser.add_argument('-n', '--no-exit', action='store_true',
@@ -115,6 +118,10 @@ def main():
115118
docker_args += ["-e", "RPMBUILD_DEFINE=%s" % args.define]
116119
if args.rpmbuild_opts:
117120
docker_args += ["-e", "RPMBUILD_OPTS=%s" % ' '.join(args.rpmbuild_opts)]
121+
if args.rpmbuild_stage:
122+
if args.rpmbuild_stage not in RPMBUILD_STAGES:
123+
parser.error(f"--rpmbuild-stage={args.rpmbuild_stage} not in '{RPMBUILD_STAGES}'")
124+
docker_args += ["-e", f"RPMBUILD_STAGE={args.rpmbuild_stage}"]
118125
if args.output_dir:
119126
if not os.path.isdir(args.output_dir):
120127
parser.error("%s is not a valid output directory." %

0 commit comments

Comments
 (0)