diff options
author | Dave Reisner <dreisner@archlinux.org> | 2020-03-25 11:03:58 -0400 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2021-01-23 11:06:15 -0800 |
commit | 3cee67ddd75114f9557ab7e13ef1751c277d9bd3 (patch) | |
tree | 9adee9e2e93d0c8b923cc54c8ad1651a574c2bb3 /testsuite | |
parent | 63fd63077de273d24574acb26ecf863587bf2ecc (diff) | |
download | kmod-3cee67ddd75114f9557ab7e13ef1751c277d9bd3.tar.gz kmod-3cee67ddd75114f9557ab7e13ef1751c277d9bd3.tar.bz2 kmod-3cee67ddd75114f9557ab7e13ef1751c277d9bd3.zip |
populate-modules: Use more bash, more quotes
We're already using associatives arrays, so there's no reason we should
be using 'test'.
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/populate-modules.sh | 18 |
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 |