From 685b2cb71a181400fc5a28905722dfbceea2bb40 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 23 Sep 2021 22:08:11 +0100 Subject: [PATCH] 8.4 to just 8 --- lgsm/data/{almalinux-8.4.csv => almalinux-8.csv} | 0 lgsm/data/{rhel-7.4.csv => rhel-7.csv} | 0 lgsm/data/{rhel-8.4.csv => rhel-8.csv} | 0 lgsm/data/{rocky-8.4.csv => rocky-8.csv} | 0 lgsm/functions/check_deps.sh | 5 +++++ lgsm/functions/info_distro.sh | 3 +++ 6 files changed, 8 insertions(+) rename lgsm/data/{almalinux-8.4.csv => almalinux-8.csv} (100%) rename lgsm/data/{rhel-7.4.csv => rhel-7.csv} (100%) rename lgsm/data/{rhel-8.4.csv => rhel-8.csv} (100%) rename lgsm/data/{rocky-8.4.csv => rocky-8.csv} (100%) diff --git a/lgsm/data/almalinux-8.4.csv b/lgsm/data/almalinux-8.csv similarity index 100% rename from lgsm/data/almalinux-8.4.csv rename to lgsm/data/almalinux-8.csv diff --git a/lgsm/data/rhel-7.4.csv b/lgsm/data/rhel-7.csv similarity index 100% rename from lgsm/data/rhel-7.4.csv rename to lgsm/data/rhel-7.csv diff --git a/lgsm/data/rhel-8.4.csv b/lgsm/data/rhel-8.csv similarity index 100% rename from lgsm/data/rhel-8.4.csv rename to lgsm/data/rhel-8.csv diff --git a/lgsm/data/rocky-8.4.csv b/lgsm/data/rocky-8.csv similarity index 100% rename from lgsm/data/rocky-8.4.csv rename to lgsm/data/rocky-8.csv diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 9c9b3ffdc..33c621cb2 100755 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -298,6 +298,11 @@ fi info_distro.sh +# some RHEL based distros use 8.4 instead of just 8. +if [[ "${distroidlike}" == *"rhel"* ]]||[ "${distroid}" == "rhel" ]; then + distroversion="${distroversionrh}" +fi + if [ ! -f "${tmpdir}/dependency-no-check.tmp" ]&&[ ! -f "${datadir}/${distroid}-${distroversion}.csv" ]; then # Check that the disto dependency csv file exists. fn_check_file_github "lgsm/data" "${distroid}-${distroversion}.csv" diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 626ef4133..0e3375b07 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -35,7 +35,10 @@ for distro_info in "${distro_info_array[@]}"; do if [ -f "/etc/os-release" ]&&[ "${distro_info}" == "os-release" ]; then distroname="$(grep "PRETTY_NAME" /etc/os-release | awk -F\= '{gsub(/"/,"",$2);print $2}')" distroversion="$(grep "VERSION_ID" /etc/os-release | awk -F\= '{gsub(/"/,"",$2);print $2}')" + # Special var for rhel like distros to removed point in number e.g 8.4 to just 8. + distroversionrh="$(printf "%.0f\n" "${distroname}")" distroid="$(grep "ID=" /etc/os-release | grep -v _ID | awk -F\= '{gsub(/"/,"",$2);print $2}')" + distroidlike="$(grep "ID_LIKE=" /etc/os-release | grep -v _ID | awk -F\= '{gsub(/"/,"",$2);print $2}')" distrocodename="$(grep "VERSION_CODENAME" /etc/os-release | awk -F\= '{gsub(/"/,"",$2);print $2}')" elif [ "$(command -v lsb_release 2>/dev/null)" ]&&[ "${distro_info}" == "lsb_release" ]; then if [ -z "${distroname}" ];then