remove-old-kernels: Fix conversion of kernelrelease (V-F-R) to package's F-V-R format

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
This commit is contained in:
Виталий Чикунов 2022-06-26 01:29:18 +03:00
parent 55432dea39
commit 4a00d27a2b

View File

@ -100,7 +100,13 @@ else
fi
echo "Checking for installed kernel packages..."
flavour_version_release="$(echo $uname_r | awk -F- '{print $2"-"$3"-"$1"-"$4}')"
# Rewrite `uname -r's kernelrelease (V-F-R) to package's F-V-R format
tver=${uname_r%%-*}
trel=${uname_r##*-}
tflv=${uname_r#"$tver"-}
tflv=${tflv%-"$trel"}
flavour_version_release=$tflv-$tver-$trel
unset tver trel tflv
echo "For removing:"
for kernel_flavour in $flavours