dist: optimize version parsing

Upstream: no

A minor optimization.

Signed-off-by: Kairui Song <kasong@tencent.com>
This commit is contained in:
Kairui Song 2024-05-24 17:35:08 +08:00
parent 7c237644c8
commit db277b0d22
1 changed files with 4 additions and 1 deletions

View File

@ -221,7 +221,6 @@ get_kernel_code_version() {
if [ ! "$makefile" ]; then
die "Error: Failed to read Makefile"
return 1
fi
KVERSION=$(get_makefile_var VERSION <<< "$makefile")
@ -305,6 +304,10 @@ _check_strip_kernel_majver() {
local makefile
local _kversion _kpatchlevel _ksublevel
if [[ $tag != *.* ]]; then
return 1
fi
if rel=$(_do_strip_kernel_majver "$tag"); then
echo "$rel"
return 0