diff options
author | Ken Dreyer <kdreyer@redhat.com> | 2022-09-09 17:29:36 +0200 |
---|---|---|
committer | Ken Dreyer <kdreyer@redhat.com> | 2022-09-27 17:21:18 +0200 |
commit | 32863d92c492d78ef531a315fde95dce4ae588f4 (patch) | |
tree | 1d24463086e95fb3032abff15696ec1fed8556b4 /win32_build.sh | |
parent | Merge pull request #47876 from torchiaf/fix/43116-2 (diff) | |
download | ceph-32863d92c492d78ef531a315fde95dce4ae588f4.tar.xz ceph-32863d92c492d78ef531a315fde95dce4ae588f4.zip |
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 <kdreyer@redhat.com>
Diffstat (limited to 'win32_build.sh')
-rwxr-xr-x | win32_build.sh | 17 |
1 files changed, 10 insertions, 7 deletions
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" |