]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
win32: parse /etc/os-release on all distros
authorKen Dreyer <kdreyer@redhat.com>
Fri, 9 Sep 2022 15:29:36 +0000 (15:29 +0000)
committerKen Dreyer <kdreyer@redhat.com>
Tue, 27 Sep 2022 15:21:18 +0000 (11:21 -0400)
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>
win32_build.sh

index 0f791e1b5625805977bd9efa821e6bf0eb655979..1f81d34ae493d19c70dd5bab26c6994a26e878d7 100755 (executable)
@@ -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"