]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Stop using lsb for rpm-based distros 2063/head
authorDavid Galloway <dgallowa@redhat.com>
Thu, 11 Aug 2022 13:31:48 +0000 (09:31 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 11 Aug 2022 13:31:48 +0000 (09:31 -0400)
lsb_release was removed in EL9 and we already have functions to read /etc/os-release and return the values we want.

Signed-off-by: David Galloway <dgallowa@redhat.com>
18 files changed:
ansible/files/rpmmacros.j2
ceph-build/build/setup_rpm
ceph-dev-new-build/build/setup_rpm
ceph-iscsi-cli/build/build_rpm
ceph-iscsi-config/build/build_rpm
ceph-iscsi-stable/build/build_rpm
ceph-iscsi-tools/build/build_rpm
ceph-iscsi/build/build_rpm
cephmetrics-release/build/build_rpm
cephmetrics/build/build_rpm
configshell-fb/build/build_rpm
diamond-build/build/build_rpm
kernel/build/setup
nfs-ganesha-stable/build/build_rpm
nfs-ganesha/build/build_rpm
rtslib-fb/build/build_rpm
samba/build/build_rpm
tcmu-runner/build/build_rpm

index 55ded864ba953cb40d27ea3b614bf00298adf7a2..7bce42c7b53ab8dac0c784819a8703cb27205a72 100644 (file)
@@ -1 +1 @@
-%dist .el{{ ansible_lsb.major_release }}
+%dist .el{{ ansible_distribution_major_version }}
index 809aaceddc9236115769e270d396c817ecabcdee..af2c1e288f51f2d54edf89c9cd1f5e867d0885cf 100644 (file)
@@ -18,8 +18,6 @@ if test $(id -u) != 0 ; then
 fi
 export LC_ALL=C # the following is vulnerable to i18n
 
-$SUDO yum install -y redhat-lsb-core
-
 mv ceph-build/ansible/ceph/dist .
 rm -rf ceph-build
 
index c63763e3bee1a8f0acd6d128bc31e0cbdcc388af..c52bf290a19595b7b4bff506f7516b6ce36c488c 100644 (file)
@@ -18,7 +18,7 @@ if test $(id -u) != 0 ; then
 fi
 export LC_ALL=C # the following is vulnerable to i18n
 
-$SUDO yum install -y redhat-lsb-core yum-utils
+$SUDO yum install -y yum-utils
 
 get_rpm_dist
 
index 885c234939977a526ea1b15fe0c5b8751e278d1f..bd3c54a5e0f5f03861130d3b6ae2bba066da40bb 100644 (file)
@@ -14,7 +14,7 @@ sudo yum install -y mock
 
 ## Get some basic information about the system and the repository
 # Get version
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # system release
+get_rpm_dist
 VERSION="$(git describe --abbrev=0 --tags HEAD)"
 REVISION="$(git describe --tags HEAD | cut -d - -f 2- | sed 's/-/./')"
 if [ "$VERSION" = "$REVISION" ]; then
index 891e1fdafeceb17102978e58dcb2e6727f297298..f1bf4254e06ffb193365cbdfacec7a00485d56a1 100644 (file)
@@ -14,7 +14,7 @@ sudo yum install -y mock
 
 ## Get some basic information about the system and the repository
 # Get version
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # system release
+get_rpm_dist
 VERSION="$(git describe --abbrev=0 --tags HEAD)"
 REVISION="$(git describe --tags HEAD | cut -d - -f 2- | sed 's/-/./')"
 if [ "$VERSION" = "$REVISION" ]; then
index ea03ace2c08d64dd6400986e82721a3f0e46ce10..9075144554dbceab7389ec8750c5ea9980d5149b 100644 (file)
@@ -13,7 +13,7 @@ for project in $(ls -h | grep -v dist); do
   cd $WORKSPACE/$PROJECT
 
   # Get some basic information about the system and the repository
-  RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # system release
+  get_rpm_dist
   VERSION="$(git describe --abbrev=0 --tags HEAD)" # for ceph-iscsi, this will return the major version number (e.g., 2)
   MAJOR_VERSION=$(echo $VERSION | cut -d '.' -f1)
   if [ $MAJOR_VERSION -gt $REPO_MAJOR_VERSION ] ; then
index f49add5af3fbac390f165d1211931f95393b3c0a..433f85949dbb03bee950f663876a9a135f0b8ebf 100644 (file)
@@ -14,7 +14,7 @@ sudo yum install -y mock
 
 ## Get some basic information about the system and the repository
 # Get version
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # system release
+get_rpm_dist
 VERSION="$(git describe --abbrev=0 --tags HEAD)"
 REVISION="$(git describe --tags HEAD | cut -d - -f 2- | sed 's/-/./')"
 if [ "$VERSION" = "$REVISION" ]; then
index 7cac80385c6ea4188bfdb26ce069c7695ef6198e..db272ff8cabbcee4768bfc590df4c63aea8c4b29 100644 (file)
@@ -14,7 +14,7 @@ sudo yum install -y mock
 
 ## Get some basic information about the system and the repository
 # Get version
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # system release
+get_rpm_dist
 VERSION="$(git describe --abbrev=0 --tags HEAD)"
 REVISION="$(git describe --tags HEAD | cut -d - -f 2- | sed 's/-/./')"
 if [ "$VERSION" = "$REVISION" ]; then
index eabb22f045f765555a8edf72ef32b36f8b15e0d6..0b2daa44a1669c3a8635cd2fce518bb4488149fe 100644 (file)
@@ -9,9 +9,7 @@ fi
 
 
 ## Install any setup-time deps (to make dist package)
-
-# We need this to get the major version from lsb_release
-sudo yum install -y redhat-lsb-core mock git wget
+sudo yum install -y mock git wget
 
 # Run the install-deps.sh upstream script if it exists
 if [ -x install-deps.sh ]; then
@@ -21,7 +19,7 @@ fi
 
 
 ## Get some basic information about the system and the repository
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # sytem release
+get_rpm_dist
 VERSION="0.1"
 REVISION="$(git rev-list --count HEAD)-g$(git rev-parse --short HEAD)"
 RPM_RELEASE=$(echo $REVISION | tr '-' '_') # the '-' has a special meaning
index c84a9ae62a8a8ab72847bffdb30a90207907ed57..702017889d519520a80f440e5b4a43c3e339df2b 100644 (file)
@@ -13,9 +13,7 @@ fi
 
 
 ## Install any setup-time deps (to make dist package)
-
-# We need this to get the major version from lsb_release
-sudo yum install -y redhat-lsb-core mock git wget
+sudo yum install -y mock git wget
 
 # Run the install-deps.sh upstream script if it exists
 if [ -x install-deps.sh ]; then
@@ -25,7 +23,7 @@ fi
 
 
 ## Get some basic information about the system and the repository
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # sytem release
+get_rpm_dist
 DESCRIBE="$(git describe --tags 2>/dev/null | cut -b 2-)"
 test -z "$DESCRIBE" && DESCRIBE="0.1-$(git rev-list --count HEAD)-g$(git rev-parse --short HEAD)"
 VERSION="$(echo $DESCRIBE | cut -d - -f 1)"
index da09f9fcfebf8f14baf48ab97dcc393d2470063a..eab29b423a71e0c3c3ba47b5baeb51b42905e37b 100644 (file)
@@ -19,7 +19,7 @@ sudo gem install fpm
 
 ## Get some basic information about the system and the repository
 # Get version
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # system release
+get_rpm_dist
 VERSION="$(git describe --abbrev=0 --tags HEAD | sed -e 's/v//1;')"
 REVISION="$(git describe --tags HEAD | sed -e 's/v//1;' | cut -d - -f 2- | sed 's/-/./')"
 if [ "$VERSION" = "$REVISION" ]; then
index 4edc8e7800918fcd60387bec2390ba0e2edc78da..c47b7f041254637ea25222b7a44c2794194aec3f 100644 (file)
@@ -8,51 +8,6 @@ fi
 
 cd $WORKSPACE
 
-get_rpm_dist() {
-    LSB_RELEASE=/usr/bin/lsb_release
-    [ ! -x $LSB_RELEASE ] && echo unknown && exit
-
-    ID=`$LSB_RELEASE --short --id`
-
-    case $ID in
-    RedHatEnterpriseServer)
-        RELEASE=`$LSB_RELEASE --short --release | cut -d. -f1`
-        DIST=rhel$RELEASE
-        DISTRO=rhel
-        ;;
-    CentOS)
-        RELEASE=`$LSB_RELEASE --short --release | cut -d. -f1`
-        DIST=el$RELEASE
-        DISTRO=centos
-        ;;
-    Fedora)
-        RELEASE=`$LSB_RELEASE --short --release`
-        DIST=fc$RELEASE
-        DISTRO=fedora
-        ;;
-    SUSE\ LINUX)
-        DESC=`$LSB_RELEASE --short --description`
-        RELEASE=`$LSB_RELEASE --short --release`
-        case $DESC in
-        *openSUSE*)
-                DIST=opensuse$RELEASE
-                DISTRO=opensuse
-            ;;
-        *Enterprise*)
-                DIST=sles$RELEASE
-                DISTRO=sles
-                ;;
-            esac
-        ;;
-    *)
-        DIST=unknown
-        DISTRO=unknown
-        ;;
-    esac
-
-    echo $DIST
-}
-
 get_rpm_dist
 dist=$DIST
 [ -z "$dist" ] && echo no dist && exit 1
index a8ede06f9e3f8b6b9c4e1e1bd112b888e5feda35..fe39c16289dd33f811bd2a1b835889e4375412e3 100644 (file)
@@ -30,7 +30,6 @@ fi
 export LC_ALL=C # the following is vulnerable to i18n
 
 if test -f /etc/redhat-release ; then
-    $SUDO yum install -y redhat-lsb-core
     $SUDO yum install -y elfutils-libelf-devel  # for ORC unwinder
     $SUDO yum install -y flex bison  # for Kconfig
 
@@ -51,10 +50,10 @@ if which apt-get > /dev/null ; then
     NORMAL_DISTRO_VERSION=$AVAILABLE_DIST
 fi
 
-case $(lsb_release -si) in
-CentOS|Fedora|SUSE*|RedHatEnterpriseServer)
-        case $(lsb_release -si) in
-            SUSE*)
+case $DISTRO in
+rhel|centos|fedora|sles|opensuse-leap)
+        case $DISTRO in
+            opensuse)
                 $SUDO zypper -y yum-utils
                 ;;
             *)
@@ -63,7 +62,7 @@ CentOS|Fedora|SUSE*|RedHatEnterpriseServer)
         esac
         ;;
 *)
-        echo "$(lsb_release -si) is unknown, dependencies will have to be installed manually."
+        echo "$DISTRO is unknown, dependencies will have to be installed manually."
         ;;
 esac
 
index 6ab42b6235bcd0e13e92185ca025f8e2de7704e8..3592c0b92054b268c10a2fecb4bbf9b2ed9e3bc6 100644 (file)
@@ -6,8 +6,7 @@ if test "$DISTRO" != "fedora" -a "$DISTRO" != "centos" -a "$DISTRO" != "rhel"; t
     exit 0
 fi
 
-## Get some basic information about the system and the repository
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # sytem release
+get_rpm_dist
 
 # Make sure old rpms are not leftover on the system
 sudo yum remove -y librados2 librgw2 libcephfs2 librados-devel librgw-devel libcephfs-devel
index 1b7ba9728522457cce97fbbe13163c48dc540f6c..2fa173bc15ef03c427e4ee20649ba51f86b7d1ce 100644 (file)
@@ -6,8 +6,7 @@ if test "$DISTRO" != "fedora" -a "$DISTRO" != "centos" -a "$DISTRO" != "rhel"; t
     exit 0
 fi
 
-## Get some basic information about the system and the repository
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # sytem release
+get_rpm_dist
 
 # Disable the google-chrome repo on el7, which is not needed (el8 doesn't have this repo).
 if [ $DIST = centos7 ]
index 24e49b74b656764306af2317fd8189de36ec3083..7bd91f019ea3d39ac061c953b5b6ca3a9e82ebd1 100644 (file)
@@ -19,7 +19,7 @@ sudo gem install fpm
 
 ## Get some basic information about the system and the repository
 # Get version
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # system release
+get_rpm_dist
 VERSION="$(git describe --abbrev=0 --tags HEAD | sed -e 's/v//1;')"
 REVISION="$(git describe --tags HEAD | sed -e 's/v//1;' | cut -d - -f 2- | sed 's/-/./')"
 if [ "$VERSION" = "$REVISION" ]; then
index b5be6b920a5131f76316edcc05b8a678ee470e67..4077fc110219623d9774ce915921a9a35f1a50be 100644 (file)
@@ -6,7 +6,7 @@ if test "$DISTRO" != "fedora" -a "$DISTRO" != "centos" -a "$DISTRO" != "rhel"; t
     exit 0
 fi
 
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # sytem release
+get_rpm_dist
 
 ## Get the desired CEPH_BRANCH/CEPH_SHA1 ceph repo
 # Get .repo file from appropriate shaman build
index 1b1cc263a15f3349a1657591bf48f0c9069c8fc2..c563af59002044ec0840d38f334af220fb5ade26 100644 (file)
@@ -10,8 +10,6 @@ if test "$DISTRO" != "fedora" -a "$DISTRO" != "centos" -a "$DISTRO" != "rhel"; t
     exit 0
 fi
 
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # sytem release
-
 ## Get the desired CEPH_BRANCH/CEPH_SHA1 ceph repo
 # Get .repo file from appropriate shaman build
 REPO_URL="https://shaman.ceph.com/api/repos/ceph/$CEPH_BRANCH/$CEPH_SHA1/$DISTRO/$RELEASE/flavors/default/repo"
@@ -41,7 +39,7 @@ sudo yum install -y mock
 
 ## Get some basic information about the system and the repository
 # Get version
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # system release
+get_rpm_dist
 VERSION="$(git describe --abbrev=0 --tags HEAD | sed -e 's/v//1;' | cut -d - -f 1)"
 REVISION="$(git describe --tags HEAD | sed -e 's/v//1;' | cut -d - -f 2- | sed 's/-/./g' | sed 's/^rc/0./')"
 if [ "$VERSION" = "$REVISION" ]; then