SHA256
1
0
forked from pool/kmod
kmod/kmod-populate-modules-Use-more-bash-more-quotes.patch
Jan Engelhardt b935d3ec1c Accepting request 869163 from home:michals
- Fix tests to not test disabled features. Disable zstd again.
  + kmod-populate-modules-Use-more-bash-more-quotes.patch
  + kmod-testsuite-compress-modules-if-feature-is-enabled.patch
  + kmod-also-test-xz-compression.patch

OBS-URL: https://build.opensuse.org/request/show/869163
OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=182
2021-02-09 15:44:57 +00:00

66 lines
1.8 KiB
Diff

From 3cee67ddd75114f9557ab7e13ef1751c277d9bd3 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Wed, 25 Mar 2020 11:03:58 -0400
Subject: [PATCH] populate-modules: Use more bash, more quotes
We're already using associatives arrays, so there's no reason we should
be using 'test'.
---
testsuite/populate-modules.sh | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/testsuite/populate-modules.sh b/testsuite/populate-modules.sh
index 358e7405dcf8..b0cc932818e0 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
--
2.26.2