From 3d2b1257f1c0fd440d5cea98e709970e5ea59084 Mon Sep 17 00:00:00 2001 From: Tk-Glitch Date: Mon, 3 Oct 2022 20:30:49 +0200 Subject: [PATCH] Set _sub to "0" when _kver_split[2] is null Fixes release kernel versioning, which is lacking the subversion. Example: kernel 6.0 release was versioned as "6.0." and will now be "6.0.0". This also unifies versioning as it'll now always be x.x.x format. --- linux-tkg-config/prepare | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-tkg-config/prepare b/linux-tkg-config/prepare index e0d40d5..0d03e12 100644 --- a/linux-tkg-config/prepare +++ b/linux-tkg-config/prepare @@ -176,7 +176,11 @@ _set_kver_internal_vars() { _basever="${_kver_split[0]}${_kver_split[1]}" # examples: "5", "rc2", "122" - _sub="${_kver_split[2]}" + if [ -n "${_kver_split[2]}" ]; then + _sub="${_kver_split[2]}" + else + _sub="0" + fi # Append a zero to the minor if it has single digit [[ ${#_kver_split[1]} == "1" ]] && _kver_split[1]="0${_kver_split[1]}"