]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
build_utils.sh: CentOS 9 Stream support for get_rpm_dist lsb-c9 1960/head
authorDavid Galloway <dgallowa@redhat.com>
Tue, 1 Feb 2022 16:52:28 +0000 (11:52 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Tue, 1 Feb 2022 16:52:28 +0000 (11:52 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
scripts/build_utils.sh

index a435ecdfe4a78ee5674b7132e75bd072e7845a69..5017e1d627bdb5150e58703c4956da4a0cc0a3fe 100644 (file)
@@ -257,9 +257,11 @@ get_rpm_dist() {
     # use in constructing chacra urls for rpm distros
 
     LSB_RELEASE=/usr/bin/lsb_release
-    [ ! -x $LSB_RELEASE ] && echo unknown && exit
-
-    ID=`$LSB_RELEASE --short --id`
+    if [ ! -x $LSB_RELEASE ]; then
+        source /etc/os-release
+    else
+        ID=`$LSB_RELEASE --short --id`
+    fi
 
     case $ID in
     RedHatEnterpriseServer)
@@ -267,8 +269,12 @@ get_rpm_dist() {
         DIST=rhel$RELEASE
         DISTRO=rhel
         ;;
-    CentOS|CentOSStream)
-        RELEASE=`$LSB_RELEASE --short --release | cut -d. -f1`
+    CentOS|CentOSStream|centos)
+        if [ "$VERSION_ID" == "9" ]; then
+            RELEASE="9"
+        else
+            RELEASE=`$LSB_RELEASE --short --release | cut -d. -f1`
+        fi
         DIST=el$RELEASE
         DISTRO=centos
         ;;
@@ -293,6 +299,8 @@ get_rpm_dist() {
     *)
         DIST=unknown
         DISTRO=unknown
+        echo "Unknown distro.  Exiting."
+        exit 1
         ;;
     esac
     DISTRO_VERSION=$RELEASE