aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2020-03-25 11:03:58 -0400
committerLucas De Marchi <lucas.demarchi@intel.com>2021-01-23 11:06:15 -0800
commit3cee67ddd75114f9557ab7e13ef1751c277d9bd3 (patch)
tree9adee9e2e93d0c8b923cc54c8ad1651a574c2bb3
parent63fd63077de273d24574acb26ecf863587bf2ecc (diff)
downloadkmod-3cee67ddd75114f9557ab7e13ef1751c277d9bd3.tar.gz
populate-modules: Use more bash, more quotes
We're already using associatives arrays, so there's no reason we should be using 'test'.
-rwxr-xr-xtestsuite/populate-modules.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/testsuite/populate-modules.sh b/testsuite/populate-modules.sh
index 358e740..b0cc932 100755
--- a/testsuite/populate-modules.sh
+++ b/testsuite/populate-modules.sh
@@ -85,15 +85,15 @@ attach_pkcs7_array=(
"test-modinfo/mod-simple-pkcs7.ko"
)
-for k in ${!map[@]}; do
+for k in "${!map[@]}"; do
dst=${ROOTFS}/$k
src=${MODULE_PLAYGROUND}/${map[$k]}
- if test "${dst: -1}" = "/"; then
- install -d $dst
- install -t $dst $src
+ if [[ $dst = */ ]]; then
+ install -d "$dst"
+ install -t "$dst" "$src"
else
- install -D $src $dst
+ install -D "$src" "$dst"
fi
done
@@ -101,7 +101,7 @@ done
# gzip these modules
for m in "${gzip_array[@]}"; do
- gzip $ROOTFS/$m
+ gzip "$ROOTFS/$m"
done
# zstd-compress these modules
@@ -110,13 +110,13 @@ for m in "${zstd_array[@]}"; do
done
for m in "${attach_sha1_array[@]}"; do
- cat ${MODULE_PLAYGROUND}/dummy.sha1 >> ${ROOTFS}/$m
+ cat "${MODULE_PLAYGROUND}/dummy.sha1" >>"${ROOTFS}/$m"
done
for m in "${attach_sha256_array[@]}"; do
- cat ${MODULE_PLAYGROUND}/dummy.sha256 >> ${ROOTFS}/$m
+ cat "${MODULE_PLAYGROUND}/dummy.sha256" >>"${ROOTFS}/$m"
done
for m in "${attach_pkcs7_array[@]}"; do
- cat ${MODULE_PLAYGROUND}/dummy.pkcs7 >> ${ROOTFS}/$m
+ cat "${MODULE_PLAYGROUND}/dummy.pkcs7" >>"${ROOTFS}/$m"
done