Merge "Use $YUM instead of direct calls in more places"

This commit is contained in:
Zuul 2019-10-05 02:59:19 +00:00 committed by Gerrit Code Review
commit 132bfb086e
4 changed files with 10 additions and 6 deletions

View File

@ -8,7 +8,7 @@ set -o pipefail
if [[ ${DISTRO_NAME} =~ "centos" ]]; then if [[ ${DISTRO_NAME} =~ "centos" ]]; then
# Centos has "epel-release" in extras, which is default enabled. # Centos has "epel-release" in extras, which is default enabled.
yum install -y epel-release ${YUM} install -y epel-release
else else
# For RHEL, we have to scrape the download page to find the latest # For RHEL, we have to scrape the download page to find the latest
# release and install that # release and install that
@ -34,7 +34,11 @@ else
fi fi
if [ ${DIB_EPEL_DISABLED:-0} -ne 0 ]; then if [ ${DIB_EPEL_DISABLED:-0} -ne 0 ]; then
yum-config-manager --disable epel if [[ ${YUM} == "dnf" ]]; then
dnf config-manager --set-disabled epel
else
yum-config-manager --disable epel
fi
fi fi
DIB_EPEL_MIRROR=${DIB_EPEL_MIRROR:-} DIB_EPEL_MIRROR=${DIB_EPEL_MIRROR:-}

View File

@ -28,7 +28,7 @@ else
exit 1 exit 1
fi fi
if [[ $DISTRO_NAME == "fedora" ]]; then if [[ ${YUM} == "dnf" ]]; then
mkdir -p /etc/dnf/vars mkdir -p /etc/dnf/vars
echo $basearch > /etc/dnf/vars/basearch echo $basearch > /etc/dnf/vars/basearch
echo $arch > /etc/dnf/vars/arch echo $arch > /etc/dnf/vars/arch
@ -43,5 +43,5 @@ if [[ ${DISTRO_NAME} =~ "centos" ]]; then
else else
contentdir=altarch contentdir=altarch
fi fi
echo $contentdir > /etc/yum/vars/contentdir echo $contentdir > /etc/${YUM}/vars/contentdir
fi fi

View File

@ -6,7 +6,7 @@ fi
set -eu set -eu
set -o pipefail set -o pipefail
if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then if [[ ${YUM} == "dnf" ]]; then
cfg=/etc/dnf/dnf.conf cfg=/etc/dnf/dnf.conf
cachedir=/var/cache/dnf cachedir=/var/cache/dnf
else else

View File

@ -6,7 +6,7 @@ fi
set -eu set -eu
set -o pipefail set -o pipefail
if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then if [[ ${YUM} == "dnf" ]]; then
# dnf is slightly different; doesn't have these by default # dnf is slightly different; doesn't have these by default
cfg=/etc/dnf/dnf.conf cfg=/etc/dnf/dnf.conf
echo "keepcache=1" >> $cfg echo "keepcache=1" >> $cfg