From 6065050022053478ac77aa6c34e3d71339080880 Mon Sep 17 00:00:00 2001 From: Brad Hubbard Date: Fri, 25 Oct 2019 15:51:38 +1000 Subject: [PATCH] install-deps.sh: Use dnf for rhel/centos 8 Also install the correct dnf-utils package rather than yum-utils. Fixes: https://tracker.ceph.com/issues/42504 Co-Authored-By: Kefu Chai Signed-off-by: Brad Hubbard --- install-deps.sh | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/install-deps.sh b/install-deps.sh index 7c4732efc30..714fb268eb5 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -343,11 +343,11 @@ else if [ "$control" != "debian/control" ] ; then rm $control; fi ;; centos|fedora|rhel|ol|virtuozzo) - yumdnf="yum" - builddepcmd="yum-builddep -y --setopt=*.skip_if_unavailable=true" - if test "$(echo "$VERSION_ID >= 22" | bc)" -ne 0; then - yumdnf="dnf" - builddepcmd="dnf -y builddep --allowerasing" + yumdnf="dnf" + builddepcmd="dnf -y builddep --allowerasing" + if [[ $ID =~ centos|rhel ]] && version_lt $VERSION_ID 8; then + yumdnf="yum" + builddepcmd="yum-builddep -y --setopt=*.skip_if_unavailable=true" fi echo "Using $yumdnf to install dependencies" if [ "$ID" = "centos" -a "$ARCH" = "aarch64" ]; then @@ -357,28 +357,26 @@ else fi case "$ID" in fedora) - if test $yumdnf = yum; then - $SUDO $yumdnf install -y yum-utils - fi + $SUDO $yumdnf install -y $yumdnf-utils ;; centos|rhel|ol|virtuozzo) MAJOR_VERSION="$(echo $VERSION_ID | cut -d. -f1)" - $SUDO yum install -y yum-utils + $SUDO $yumdnf install -y $yumdnf-utils if test $ID = rhel ; then $SUDO yum-config-manager --enable rhel-$MAJOR_VERSION-server-optional-rpms fi rpm --quiet --query epel-release || \ - $SUDO yum -y install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJOR_VERSION.noarch.rpm + $SUDO $yumdnf -y install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJOR_VERSION.noarch.rpm $SUDO rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$MAJOR_VERSION $SUDO rm -f /etc/yum.repos.d/dl.fedoraproject.org* if test $ID = centos -a $MAJOR_VERSION = 7 ; then case "$ARCH" in x86_64) - $SUDO yum -y install centos-release-scl + $SUDO $yumdnf -y install centos-release-scl dts_ver=8 ;; aarch64) - $SUDO yum -y install centos-release-scl-rh + $SUDO $yumdnf -y install centos-release-scl-rh $SUDO yum-config-manager --disable centos-sclo-rh $SUDO yum-config-manager --enable centos-sclo-rh-testing dts_ver=8 @@ -520,4 +518,3 @@ if $for_make_check; then rm -rf $XDG_CACHE_HOME git --version || (echo "Dashboard uses git to pull dependencies." ; false) fi -