Skip to content

Commit 534e5f1

Browse files
committed
build-recipe-mkosi: make it work in old bash versions
Old versions do not have += support...
1 parent d1e7899 commit 534e5f1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

build-recipe-mkosi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ recipe_build_mkosi() {
5050
)
5151

5252
if mkosi --help | grep -w -- "--default " >/dev/null 2>&1; then
53-
mkosi_args+=("--default=${RECIPEFILE}")
53+
mkosi_args[${#mkosi_args[@]}]="--default=${RECIPEFILE}"
5454
fi
5555

5656
if mkosi --help | grep -w -- "--nspawn-keep-unit " >/dev/null 2>&1; then
57-
mkosi_args+=("--nspawn-keep-unit")
57+
mkosi_args[${#mkosi_args[@]}]="--nspawn-keep-unit"
5858
fi
5959

6060
if mkosi --help | grep -w -- "--with-network " >/dev/null 2>&1; then
61-
mkosi_args+=("--with-network=never")
61+
mkosi_args[${#mkosi_args[@]}]="--with-network=never"
6262
fi
6363

6464
if mkosi --help | grep -w -- "--cache " >/dev/null 2>&1; then
65-
mkosi_args+=("--cache=/.build.binaries/")
65+
mkosi_args[${#mkosi_args[@]}]="--cache=/.build.binaries/"
6666
fi
6767

6868
if [ -x "$BUILD_ROOT/bin/rpm" ]; then
@@ -84,7 +84,7 @@ recipe_build_mkosi() {
8484
fi
8585

8686
# Pass it to mkosi, so that the configured mirror is the same as the repository created below
87-
mkosi_args+=("--release=${DIST}")
87+
mkosi_args[${#mkosi_args[@]}]="--release=${DIST}"
8888

8989
test -z "${ARCH}" -o -z "${DIST}" && cleanup_and_exit 1
9090
elif [ ! -x "$BUILD_ROOT/usr/bin/repo-add" ]; then
@@ -121,13 +121,13 @@ recipe_build_mkosi() {
121121
workdir="$d"
122122
break
123123
done
124-
mkosi_args+=("--directory=${workdir}")
124+
mkosi_args[${#mkosi_args[@]}]="--directory=${workdir}"
125125

126126
if [ -n "$RELEASE" ]; then
127-
mkosi_args+=("--image-version=${RELEASE}")
127+
mkosi_args[${#mkosi_args[@]}]="--image-version=${RELEASE}"
128128
else
129129
# Provide some fallback value for %v specifiers
130-
mkosi_args+=("--image-version=0")
130+
mkosi_args[${#mkosi_args[@]}]="--image-version=0"
131131
fi
132132

133133
set -- mkosi "${mkosi_args[@]}" build

0 commit comments

Comments
 (0)