Merge pull request #31144 from badone/wip-use-dnf-on-rhel-or-centos-8

install-deps.sh: Use dnf for rhel/centos 8

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2019-12-17 12:03:54 +08:00 committed by GitHub
commit 6b009b49f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -354,11 +354,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"
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
@ -368,28 +368,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
@ -538,4 +536,3 @@ if $for_make_check; then
rm -rf $XDG_CACHE_HOME
git --version || (echo "Dashboard uses git to pull dependencies." ; false)
fi