From 32c99bc86e6b7745d3a3286c345b335839909a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sun, 22 May 2022 16:20:56 +0200 Subject: [PATCH 1/3] Don't ignore kernel-install for shellcheck --- .github/workflows/linter.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 1ba9236425..3fdb24b0ea 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -37,8 +37,9 @@ jobs: # - man/.* - all snippets in man pages (false positives due to # missing shebangs) # - .*\.(in|SKELETON) - all template/skeleton files + # except kernel-install # - tools/coverity\.sh - external file (with some modifications) - FILTER_REGEX_EXCLUDE: .*/(man/.*|.*\.(in|SKELETON)|tools/coverity\.sh)$ + FILTER_REGEX_EXCLUDE: .*/(man/.*|([^k]|k(k|ek)*([^ek]|e[^kr]))*(k(k|ek)*e?)?\.(in|SKELETON)|tools/coverity\.sh)$ VALIDATE_ALL_CODEBASE: false VALIDATE_BASH: true # FIXME: temporarily disable validation of GH Action files, since From ee0d4cf74ab483a2fc5655fa2a9bdf280ea1ef79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sun, 22 May 2022 17:13:44 +0200 Subject: [PATCH 2/3] Fix which(1) in meson-build.sh --- tools/meson-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/meson-build.sh b/tools/meson-build.sh index 6d45e89a06..ecd558f8d9 100755 --- a/tools/meson-build.sh +++ b/tools/meson-build.sh @@ -15,7 +15,7 @@ CXX="$6" # Locate ninja binary, on CentOS 7 it is called ninja-build, so # use that name if available. ninja="ninja" -if which ninja-build >/dev/null 2>&1 ; then +if command -v ninja-build >/dev/null ; then ninja="ninja-build" fi From 35339eb88c72f30204589101765a0bca5424e253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sun, 22 May 2022 22:09:23 +0200 Subject: [PATCH 3/3] shellcheck-clean kernel-install again --- src/kernel-install/kernel-install.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kernel-install/kernel-install.in b/src/kernel-install/kernel-install.in index f43c6b8b42..c6c74cc792 100755 --- a/src/kernel-install/kernel-install.in +++ b/src/kernel-install/kernel-install.in @@ -112,6 +112,7 @@ fi if [ -n "$install_conf" ]; then [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Reading $install_conf…" + # shellcheck source=/dev/null . "$install_conf" # FIXME: This may override configuration in environment variables, e.g. $BOOT_ROOT. fi @@ -130,6 +131,7 @@ fi # generated one. If the user configured an explicit machine ID to use in # /etc/machine-info to use for our purpose, we'll use that instead (for # compatibility). +# shellcheck source=/dev/null if [ -z "$MACHINE_ID" ] && [ -r /etc/machine-info ] && . /etc/machine-info && MACHINE_ID="$KERNEL_INSTALL_MACHINE_ID"; then [ -n "$MACHINE_ID" ] && [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \ echo "machine-id $MACHINE_ID acquired from /etc/machine-info" @@ -157,6 +159,7 @@ if [ -z "$ENTRY_TOKEN" ]; then # the IMAGE_ID= and ID= fields from /etc/os-release and finally the fixed # string "Default" ENTRY_TOKEN_SEARCH="$MACHINE_ID" + # shellcheck source=/dev/null [ -r /etc/os-release ] && . /etc/os-release [ -n "$IMAGE_ID" ] && ENTRY_TOKEN_SEARCH="$ENTRY_TOKEN_SEARCH $IMAGE_ID" [ -n "$ID" ] && ENTRY_TOKEN_SEARCH="$ENTRY_TOKEN_SEARCH $ID" @@ -291,7 +294,7 @@ PLUGINS="$( IFS=" " -[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo -e "Plugin files:\n$PLUGINS" +[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && printf '%s\n' "Plugin files:" "$PLUGINS" case "$COMMAND" in add)