Commit 6b35e83b authored by Carlos Ramos Carreño's avatar Carlos Ramos Carreño Committed by Thomas Gambier

Fix SuSE detection.

`SuSE-release` was deprecated and missing in new distributions in favor of `os-release`.

See merge request nexedi/slapos.core!628
parent 1ee1c6e9
Pipeline #35283 failed with stage
in 0 seconds
...@@ -267,7 +267,7 @@ function GetOSVersion { ...@@ -267,7 +267,7 @@ function GetOSVersion {
os_VENDOR=OracleLinux os_VENDOR=OracleLinux
fi fi
os_PACKAGE="rpm" os_PACKAGE="rpm"
elif [[ -r /etc/SuSE-release ]]; then elif [[ -r /etc/os-release ]] && grep suse /etc/os-release; then
for r in openSUSE "SUSE Linux"; do for r in openSUSE "SUSE Linux"; do
if [[ "$r" = "SUSE Linux" ]]; then if [[ "$r" = "SUSE Linux" ]]; then
os_VENDOR="SUSE LINUX" os_VENDOR="SUSE LINUX"
...@@ -275,10 +275,9 @@ function GetOSVersion { ...@@ -275,10 +275,9 @@ function GetOSVersion {
os_VENDOR=$r os_VENDOR=$r
fi fi
if [[ -n "`grep \"$r\" /etc/SuSE-release`" ]]; then if [[ -n "`grep \"$r\" /etc/os-release`" ]]; then
os_CODENAME=`grep "CODENAME = " /etc/SuSE-release | sed 's:.* = ::g'` os_CODENAME=$(awk '/VERSION=/' /etc/os-release | sed 's/VERSION=//' | sed 's/\"//g')
os_RELEASE=`grep "VERSION = " /etc/SuSE-release | sed 's:.* = ::g'` os_RELEASE=$(awk '/VERSION_ID=/' /etc/os-release | sed 's/VERSION_ID=//' | sed 's/\"//g')
os_UPDATE=`grep "PATCHLEVEL = " /etc/SuSE-release | sed 's:.* = ::g'`
break break
fi fi
os_VENDOR="" os_VENDOR=""
......
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