Commit d1eeab96 authored by Vitaly Lipatov's avatar Vitaly Lipatov

distr_info: cleanup normalize_name

parent 2ab6f888
...@@ -110,7 +110,7 @@ case $DISTRIB_ID in ...@@ -110,7 +110,7 @@ case $DISTRIB_ID in
ArchLinux) ArchLinux)
CMD="pacman" CMD="pacman"
;; ;;
Fedora|FedoraLinux|LinuxXP|ASPLinux|CentOS|OracleLinux|RockyLinux|AlmaLinux|RHEL|Scientific|GosLinux|Amzn|RedOS) Fedora|CentOS|OracleLinux|RockyLinux|AlmaLinux|RHEL|Scientific|GosLinux|Amzn|RedOS)
CMD="dnf-rpm" CMD="dnf-rpm"
hascommand dnf || CMD=yum-rpm hascommand dnf || CMD=yum-rpm
[ "$DISTRIB_ID/$DISTRIB_RELEASE" = "CentOS/7" ] && CMD=yum-rpm [ "$DISTRIB_ID/$DISTRIB_RELEASE" = "CentOS/7" ] && CMD=yum-rpm
...@@ -215,13 +215,21 @@ get_major_version() ...@@ -215,13 +215,21 @@ get_major_version()
normalize_name() normalize_name()
{ {
[ "$1" = "RED OS" ] && echo "RedOS" && return case "$1" in
[ "$1" = "CentOS Linux" ] && echo "CentOS" && return "RED OS")
[ "$1" = "Rocky Linux" ] && echo "RockyLinux" && return echo "RedOS"
[ "$1" = "Oracle Linux" ] && echo "OracleLinux" && return ;;
[ "$1" = "Alma Linux" ] && echo "AlmaLinux" && return "CentOS Linux")
#echo "${1// /}" echo "CentOS"
echo "$1" | sed -e "s/ //g" ;;
"Fedora Linux")
echo "Fedora"
;;
*)
#echo "${1// /}"
echo "$1" | sed -e "s/ //g"
;;
esac
} }
# Default values # Default values
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment