]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: fix a couple of "new" shellcheck-related issues
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 22 Nov 2021 19:51:15 +0000 (20:51 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 22 Nov 2021 19:52:56 +0000 (20:52 +0100)
related to https://github.com/koalaman/shellcheck/wiki/SC2295

test/test-functions

index 00a808bf28ddf77120227fcb18d26b2c0e74530e..d3705653ae2980287ee3c9fb4d0670b6e0420050 100644 (file)
@@ -2083,7 +2083,7 @@ dfatal() {
 
 
 # Generic substring function.  If $2 is in $1, return 0.
-strstr() { [ "${1#*$2*}" != "$1" ]; }
+strstr() { [ "${1#*"$2"*}" != "$1" ]; }
 
 # normalize_path <path>
 # Prints the normalized path, where it removes any duplicated
@@ -2498,12 +2498,12 @@ image_install() {
 install_kmod_with_fw() {
     local module="${1:?}"
     # no need to go further if the module is already installed
-    [[ -e "${initdir:?}/lib/modules/${KERNEL_VER:?}/${module##*/lib/modules/$KERNEL_VER/}" ]] && return 0
+    [[ -e "${initdir:?}/lib/modules/${KERNEL_VER:?}/${module##*"/lib/modules/$KERNEL_VER/"}" ]] && return 0
     [[ -e "$initdir/.kernelmodseen/${module##*/}" ]] && return 0
 
     [ -d "$initdir/.kernelmodseen" ] && : >"$initdir/.kernelmodseen/${module##*/}"
 
-    inst_simple "$module" "/lib/modules/$KERNEL_VER/${module##*/lib/modules/$KERNEL_VER/}" || return $?
+    inst_simple "$module" "/lib/modules/$KERNEL_VER/${module##*"/lib/modules/$KERNEL_VER/"}" || return $?
 
     local modname="${module##*/}"
     local fwdir found fw