Fix CentOS 8 installations

This commit is contained in:
Pedro Algarvio 2020-05-27 18:43:57 +01:00
parent 79812ca0b0
commit 5a2eb9688d
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -2003,6 +2003,12 @@ __rpm_import_gpg() {
tempfile="$(__temp_gpg_pub)"
__fetch_url "$tempfile" "$url" || return 1
# At least on CentOS 8, a missing newline at the end causes:
# error: /tmp/salt-gpg-n1gKUb1u.pub: key 1 not an armored public key.
# shellcheck disable=SC1003,SC2086
sed -i -e '$a\' $tempfile
rpm --import "$tempfile" || return 1
rm -f "$tempfile"
@ -4109,6 +4115,14 @@ install_centos_stable_deps() {
yum -y update || return 1
fi
if [ "$DISTRO_MAJOR_VERSION" -ge 8 ]; then
# CentOS/RHEL 8 Default to Py3
if [ "x${_PY_EXE}" = "x" ]; then
_PY_EXE=python3
_PY_MAJOR_VERSION=3
fi
fi
if [ "$_DISABLE_REPOS" -eq "$BS_TRUE" ] && [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
echoerror "Detected -r or -R option while installing Salt packages for Python 3."
echoerror "Python 3 packages for Salt require the EPEL repository to be installed."