mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Turn shellcheck into a normal make target. Fix new files it caught
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 <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #10512 Closes #12101
This commit is contained in:
+8
-6
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2086
|
||||
|
||||
# kmodtool - Helper script for building kernel module RPMs
|
||||
# Copyright (c) 2003-2012 Ville Skyttä <ville.skytta@iki.fi>,
|
||||
@@ -38,15 +39,16 @@ prefix=
|
||||
filterfile=
|
||||
target=
|
||||
buildroot=
|
||||
dashvariant=
|
||||
|
||||
error_out()
|
||||
{
|
||||
local errorlevel=${1}
|
||||
shift
|
||||
echo "Error: $@" >&2
|
||||
echo "Error: $*" >&2
|
||||
# the next line is not multi-line safe -- not needed *yet*
|
||||
echo "%global kmodtool_check echo \"kmodtool error: $@\"; exit ${errorlevel};"
|
||||
exit ${errorlevel}
|
||||
echo "%global kmodtool_check echo \"kmodtool error: $*\"; exit ${errorlevel};"
|
||||
exit "${errorlevel}"
|
||||
}
|
||||
|
||||
print_rpmtemplate_header()
|
||||
@@ -579,7 +581,7 @@ elif [[ ! "${kmodname}" ]]; then
|
||||
error_out 2 "please pass kmodname with --kmodname"
|
||||
elif [[ ! "${kernels_known_variants}" ]] ; then
|
||||
error_out 2 "could not determine known variants"
|
||||
elif ( [[ "${obsolete_name}" ]] && [[ ! "${obsolete_version}" ]] ) || ( [[ ! "${obsolete_name}" ]] && [[ "${obsolete_version}" ]] ) ; then
|
||||
elif { [[ "${obsolete_name}" ]] && [[ ! "${obsolete_version}" ]]; } || { [[ ! "${obsolete_name}" ]] && [[ "${obsolete_version}" ]]; } ; then
|
||||
error_out 2 "you need to provide both --obsolete-name and --obsolete-version"
|
||||
fi
|
||||
|
||||
@@ -597,7 +599,7 @@ else
|
||||
# we need more sanity checks in this case
|
||||
if [[ ! "${repo}" ]]; then
|
||||
error_out 2 "please provide repo name with --repo"
|
||||
elif ! $(which buildsys-build-${repo}-kerneldevpkgs &> /dev/null) ; then
|
||||
elif ! command -v "buildsys-build-${repo}-kerneldevpkgs" &> /dev/null ; then
|
||||
error_out 2 "buildsys-build-${repo}-kerneldevpkgs not found"
|
||||
fi
|
||||
|
||||
@@ -611,7 +613,7 @@ else
|
||||
|
||||
kernel_versions_to_build_for="$(buildsys-build-${repo}-kerneldevpkgs --${build_kernels} ${cmdoptions})"
|
||||
returncode=$?
|
||||
if (( ${returncode} != 0 )); then
|
||||
if (( returncode != 0 )); then
|
||||
error_out 2 "buildsys-build-${repo}-kerneldevpkgs failed: $(buildsys-build-${repo}-kerneldevpkgs --${build_kernels} ${cmdoptions})"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user