From c3ef9f7528d160faa08bbddfa29d7ad58835e1bd Mon Sep 17 00:00:00 2001 From: наб Date: Fri, 21 May 2021 23:43:38 +0200 Subject: Turn shellcheck into a normal make target. Fix new files it caught MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This checks every file it checked (and a few more), but explicitly instead of "if it works it works" best-effort (which wasn't that good anyway) Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia Ziemiańska Closes #10512 Closes #12101 --- etc/init.d/zfs-import.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'etc/init.d/zfs-import.in') diff --git a/etc/init.d/zfs-import.in b/etc/init.d/zfs-import.in index 6b1b2f243..e4bc7b833 100755 --- a/etc/init.d/zfs-import.in +++ b/etc/init.d/zfs-import.in @@ -72,6 +72,7 @@ do_import_all_visible() local exception dir ZPOOL_IMPORT_PATH RET=0 r=1 # In case not shutdown cleanly. + # shellcheck disable=SC2154 [ -n "$init" ] && rm -f /etc/dfs/sharetab # Just simplify code later on. @@ -157,7 +158,7 @@ do_import_all_visible() echo "$dir" | grep -q /by-vdev && continue [ ! -d "$dir" ] && continue - echo -n "$dir:" + printf "%s" "$dir:" done | sed 's,:$,,g')" if [ -d "/dev/disk/by-vdev" ] @@ -214,6 +215,7 @@ do_import_all_visible() # Import by using ZPOOL_IMPORT_PATH (either set above or in # the config file) _or_ with the 'built in' default search # paths. This is the preferred way. + # shellcheck disable=SC2086 "$ZPOOL" import -N ${ZPOOL_IMPORT_OPTS} "$pool" 2> /dev/null r="$?" ; RET=$((RET + r)) if [ "$r" -eq 0 ] @@ -235,6 +237,7 @@ do_import_all_visible() zfs_log_progress_msg " using cache file" fi + # shellcheck disable=SC2086 "$ZPOOL" import -c "$ZPOOL_CACHE" -N ${ZPOOL_IMPORT_OPTS} \ "$pool" 2> /dev/null r="$?" ; RET=$((RET + r)) -- cgit v1.2.3