From 32863d92c492d78ef531a315fde95dce4ae588f4 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Fri, 9 Sep 2022 15:29:36 +0000 Subject: win32: parse /etc/os-release on all distros Standardize the way that we determine Ubuntu and SUSE. This aligns with what we do in install-deps.sh and makes it simpler to add more distributions later. Signed-off-by: Ken Dreyer --- win32_build.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'win32_build.sh') diff --git a/win32_build.sh b/win32_build.sh index 0f791e1b562..1f81d34ae49 100755 --- a/win32_build.sh +++ b/win32_build.sh @@ -39,17 +39,20 @@ EMBEDDED_DBG_SYM=${EMBEDDED_DBG_SYM:-} OS=${OS} if [[ -z $OS ]]; then - if [[ -f /etc/os-release ]] && \ - $(grep -q "^NAME=\".*SUSE.*\"" /etc/os-release); then + source /etc/os-release + case "$ID" in + opensuse*|suse|sles) OS="suse" - elif [[ -f /etc/lsb-release ]] && \ - $(grep -q "^DISTRIB_ID=Ubuntu" /etc/lsb-release); then + ;; + ubuntu) OS="ubuntu" - else - echo "Unsupported Linux distro, only SUSE and Ubuntu are currently \ + ;; + *) + echo "Unsupported Linux distro $ID, only SUSE and Ubuntu are currently \ supported. Set the OS variable to override" exit 1 - fi + ;; + esac fi export OS="$OS" -- cgit v1.2.3