@@ -13,54 +13,63 @@ test -e Makefile && make distclean
13
13
14
14
./configure
15
15
16
- make -j $( nproc)
16
+ make -j " $( nproc) "
17
17
18
- VERSION=$( $( dirname $0 ) /git-version-gen --prefix " " .)
19
- if test x $SKIP_CHECKS = x ; then
20
- grep $VERSION NEWS
18
+ VERSION=" $( " $( dirname " $0 " ) /git-version-gen" --prefix " " .) "
19
+ if test " $SKIP_CHECKS " = " " ; then
20
+ grep " $VERSION " NEWS
21
21
fi
22
22
23
23
OUTDIR=${OUTDIR:- release-$VERSION }
24
- if test -e $OUTDIR ; then
24
+ if test -e " $OUTDIR " ; then
25
25
echo " the directory $OUTDIR already exists" >&2
26
26
exit 1
27
27
fi
28
28
29
- mkdir -p $OUTDIR
29
+ mkdir -p " $OUTDIR "
30
30
31
31
rm -f crun-* .tar*
32
32
33
33
make dist-gzip
34
34
make ZSTD_OPT=" --ultra -c22" dist-zstd
35
35
36
- mv crun-* .tar.gz $OUTDIR
37
- mv crun-* .tar.zst $OUTDIR
36
+ mv crun-* .tar.gz " $OUTDIR "
37
+ mv crun-* .tar.zst " $OUTDIR "
38
38
39
39
make distclean
40
40
41
- RUNTIME=${RUNTIME:- podman}
42
- RUNTIME_EXTRA_ARGS=${RUNTIME_EXTRA_ARGS:- }
41
+ read -r -a RUNTIME_EXTRA_ARGS <<< " ${RUNTIME_EXTRA_ARGS:-}"
42
+
43
+ BUILD_CMD=(
44
+ " ${RUNTIME:- podman} " run --init --rm
45
+ " ${RUNTIME_EXTRA_ARGS[@]} "
46
+ --privileged
47
+ -v /nix:/nix -v " ${PWD} :${PWD} "
48
+ -w " ${PWD} "
49
+ " ${NIX_IMAGE} "
50
+ nix
51
+ --extra-experimental-features nix-command
52
+ --print-build-logs
53
+ --option cores " $( nproc) "
54
+ --option max-jobs " $( nproc) "
55
+ build
56
+ --max-jobs auto
57
+ )
43
58
44
59
mkdir -p /nix
45
60
46
- NIX_ARGS=" --extra-experimental-features nix-command --print-build-logs --option cores $( nproc) --option max-jobs $( nproc) "
47
-
48
61
for ARCH in amd64 arm64 ppc64le riscv64 s390x; do
49
- $RUNTIME run --init --rm $RUNTIME_EXTRA_ARGS --privileged -v /nix:/nix -v ${PWD} :${PWD} -w ${PWD} ${NIX_IMAGE} \
50
- nix $NIX_ARGS build --max-jobs auto --file nix/default-${ARCH} .nix
51
- cp ./result/bin/crun $OUTDIR /crun-$VERSION -linux-${ARCH}
52
-
62
+ " ${BUILD_CMD[@]} " --file nix/default-${ARCH} .nix
63
+ cp ./result/bin/crun " $OUTDIR /crun-$VERSION -linux-${ARCH} "
53
64
rm -rf result
54
65
55
- $RUNTIME run --init --rm $RUNTIME_EXTRA_ARGS --privileged -v /nix:/nix -v ${PWD} :${PWD} -w ${PWD} ${NIX_IMAGE} \
56
- nix $NIX_ARGS build --max-jobs auto --file nix/default-${ARCH} .nix --arg enableSystemd false
57
- cp ./result/bin/crun $OUTDIR /crun-$VERSION -linux-${ARCH} -disable-systemd
58
-
66
+ " ${BUILD_CMD[@]} " --file nix/default-${ARCH} .nix --arg enableSystemd false
67
+ cp ./result/bin/crun " $OUTDIR /crun-$VERSION -linux-${ARCH} -disable-systemd"
59
68
rm -rf result
60
69
done
61
70
62
- if test x $SKIP_GPG = x ; then
63
- for i in $OUTDIR /* ; do
64
- gpg2 -b --armour $i
71
+ if test " $SKIP_GPG " = " " ; then
72
+ for i in " $OUTDIR " /* ; do
73
+ gpg2 -b --armour " $i "
65
74
done
66
75
fi
0 commit comments