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>
-%dist .el{{ ansible_lsb.major_release }}
+%dist .el{{ ansible_distribution_major_version }}
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
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
## 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
## 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
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
## 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
## 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
## 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
## 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
## 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
## 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)"
## 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
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
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
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
;;
*)
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
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
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 ]
## 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
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
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"
## 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