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
# Centos has "epel-release" in extras, which is default enabled.
yum install -y epel-release
${YUM} install -y epel-release
else
# For RHEL, we have to scrape the download page to find the latest
# release and install that
@ -34,8 +34,12 @@ else
fi
if [ ${DIB_EPEL_DISABLED:-0} -ne 0 ]; then
if [[ ${YUM} == "dnf" ]]; then
dnf config-manager --set-disabled epel
else
yum-config-manager --disable epel
fi
fi
DIB_EPEL_MIRROR=${DIB_EPEL_MIRROR:-}
[ -n "$DIB_EPEL_MIRROR" ] || exit 0

View File

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

View File

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

View File

@ -6,7 +6,7 @@ fi
set -eu
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
cfg=/etc/dnf/dnf.conf
echo "keepcache=1" >> $cfg