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
ArchLinux)
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"
hascommand dnf || CMD=yum-rpm
[ "$DISTRIB_ID/$DISTRIB_RELEASE" = "CentOS/7" ] && CMD=yum-rpm
......@@ -215,13 +215,21 @@ get_major_version()
normalize_name()
{
[ "$1" = "RED OS" ] && echo "RedOS" && return
[ "$1" = "CentOS Linux" ] && echo "CentOS" && return
[ "$1" = "Rocky Linux" ] && echo "RockyLinux" && return
[ "$1" = "Oracle Linux" ] && echo "OracleLinux" && return
[ "$1" = "Alma Linux" ] && echo "AlmaLinux" && return
#echo "${1// /}"
echo "$1" | sed -e "s/ //g"
case "$1" in
"RED OS")
echo "RedOS"
;;
"CentOS Linux")
echo "CentOS"
;;
"Fedora Linux")
echo "Fedora"
;;
*)
#echo "${1// /}"
echo "$1" | sed -e "s/ //g"
;;
esac
}
# 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