scripts/check_format: use version_lt to compare shfmt version
It turns out we have a function to compare version numbers. It additionally handles cases like "3.0.10 > 3.0.9". The previous code returned false, the new one returns true. version_lt() actually tests for less or equal, so compare against 3.1.0 - the real minimum shfmt version we need. Change-Id: Ibd18c4505e5b81c0073a907f23c3fc034cfbafbe Suggested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2574 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
a15eef8b03
commit
59ff57b93c
@ -300,7 +300,7 @@ fi
|
||||
# find compatible shfmt binary
|
||||
shfmt_bins=$(compgen -c | grep '^shfmt' || true)
|
||||
for bin in $shfmt_bins; do
|
||||
if [[ "$("$bin" --version)" > "v3.0.9" ]]; then
|
||||
if version_lt "$("$bin" --version)" "3.1.0"; then
|
||||
shfmt=$bin
|
||||
break
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user