Fix up EPEL element
For whatever reason, RHEL identifies itself with DISTRO "rhel" for 6 and "rhel7" for 7, but centos just uses "centos" and DIB_RELEASE. So this was wrong and installing EPEL6 on centos7. But we can simplify it completely for centos because that comes with the epel-release package already included. Change-Id: I2b8f5d30b850fef46b4a5ba32a917abcbf25932c
This commit is contained in:
parent
4f6ce09385
commit
2dc4154724
@ -6,19 +6,24 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
if [[ ${DISTRO_NAME} =~ "centos" ]]; then
|
||||
# Centos has "epel-release" in extras, which is default enabled.
|
||||
yum install -y epel-release
|
||||
else
|
||||
# For RHEL, we have to scrape the download page to find the latest
|
||||
# release and install that
|
||||
[ -n "$ARCH" ]
|
||||
|
||||
if [ 'amd64' = "$ARCH" ] ; then
|
||||
ARCH="x86_64"
|
||||
fi
|
||||
|
||||
BASE_URL=${DIB_EPEL_MIRROR:-https://dl.fedoraproject.org/pub/epel}
|
||||
case "$DISTRO_NAME" in
|
||||
rhel7|centos7)
|
||||
rhel7)
|
||||
RELEASE=7
|
||||
URL=$BASE_URL/$RELEASE/x86_64/e/
|
||||
;;
|
||||
rhel|centos)
|
||||
rhel)
|
||||
RELEASE=6
|
||||
URL=$BASE_URL/$RELEASE/$ARCH/
|
||||
;;
|
||||
@ -29,7 +34,7 @@ case "$DISTRO_NAME" in
|
||||
esac
|
||||
PKG_NAME=$(wget -q $URL -O - |grep -oE "(href=\"epel-release-$RELEASE-[0-9,.].*)" | cut -d'"' -f2)
|
||||
rpm -q epel-release || yum install -y $URL/$PKG_NAME
|
||||
|
||||
fi
|
||||
|
||||
DIB_EPEL_MIRROR=${DIB_EPEL_MIRROR:-}
|
||||
[ -n "$DIB_EPEL_MIRROR" ] || exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user