Merge "Use $YUM instead of direct calls in more places"
This commit is contained in:
commit
132bfb086e
4 changed files with 10 additions and 6 deletions
|
@ -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,7 +34,11 @@ else
|
|||
fi
|
||||
|
||||
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
|
||||
|
||||
DIB_EPEL_MIRROR=${DIB_EPEL_MIRROR:-}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue