Skip to content

Commit 5f0e227

Browse files
committed
mkosi: do not pass older parameters to newer versions
Some parameters have been deprecated, don't pass them if they are not in --help anymore
1 parent 56e3b58 commit 5f0e227

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

build-recipe-mkosi

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,28 @@ recipe_prepare_mkosi() {
4343
recipe_build_mkosi() {
4444
local ARCH DIST
4545
local mkosi_args=(
46-
"--default ${RECIPEFILE}"
47-
"--nspawn-keep-unit"
4846
"--output-dir=$TOPDIR/OTHER"
4947
"--checksum=yes"
5048
"--repository-key-check=no"
51-
"--with-network=never"
5249
"--local-mirror=file:///.build.binaries/"
53-
"--cache /.build.binaries/"
5450
)
5551

52+
if mkosi --help | grep "\-\-default " >/dev/null 2>&1; then
53+
mkosi_args+=("--default=${RECIPEFILE}")
54+
fi
55+
56+
if mkosi --help | grep "\-\-nspawn-keep-unit " >/dev/null 2>&1; then
57+
mkosi_args+=("--nspawn-keep-unit")
58+
fi
59+
60+
if mkosi --help | grep "\-\-with-network " >/dev/null 2>&1; then
61+
mkosi_args+=("--with-network=never")
62+
fi
63+
64+
if mkosi --help | grep "\-\-cache " >/dev/null 2>&1; then
65+
mkosi_args+=("--cache=/.build.binaries/")
66+
fi
67+
5668
if [ -x "$BUILD_ROOT/bin/rpm" ]; then
5769
ARCH=$(chroot "$BUILD_ROOT" sh -c "rpm --eval '%{_target_cpu}'")
5870
elif [ -x "$BUILD_ROOT/usr/bin/dpkg-architecture" ]; then

0 commit comments

Comments
 (0)