mirror of
https://github.com/SCST-project/scst.git
synced 2026-09-03 06:36:57 +00:00
scripts: Fix ShellCheck diagnostics
Quote scalar arguments and use arrays for command option lists so paths and options retain their boundaries. Preserve intentional version-field splitting with narrow documented suppressions. Also handle GNU getopt output without losing quoted arguments and remove warnings about masked statuses, unused values and ambiguous test expressions.
This commit is contained in:
@@ -107,10 +107,14 @@ EOF
|
||||
# passed via stdin and send the specialized patch to stdout.
|
||||
function specialize_patch {
|
||||
local ao
|
||||
# Split the kernel^distro^release triplet into positional parameters.
|
||||
# shellcheck disable=SC2086
|
||||
set -- ${1//^/ }
|
||||
local kver=$1
|
||||
local distro=$2
|
||||
local release=$3
|
||||
# Split the distribution release into major and minor components.
|
||||
# shellcheck disable=SC2086
|
||||
set -- ${release//./ }
|
||||
local releasevermajor="$1"
|
||||
local releaseverminor="$2"
|
||||
@@ -130,6 +134,8 @@ function specialize_patch {
|
||||
;;
|
||||
esac
|
||||
local kver3
|
||||
# Split the kernel release into numeric components.
|
||||
# shellcheck disable=SC2086
|
||||
set -- ${kver//[.-]/ }
|
||||
if [ -n "$3" ]; then
|
||||
kver3=$1.$2.$3
|
||||
|
||||
Reference in New Issue
Block a user