From f704c4c96b4ce6c7062f3f34a48ef746ebb3ff91 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Wed, 14 Dec 2022 22:50:07 +0100 Subject: [PATCH] ci: no need to set python2 for yum for el8 --- scripts/pkg-tests.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/pkg-tests.sh b/scripts/pkg-tests.sh index c511a08e6..768a152c0 100755 --- a/scripts/pkg-tests.sh +++ b/scripts/pkg-tests.sh @@ -47,10 +47,11 @@ export EMQX_NAME export PACKAGE_PATH="${CODE_PATH}/_packages/${EMQX_NAME}" export RELUP_PACKAGE_PATH="${CODE_PATH}/_upgrade_base" +SYSTEM="$("$SCRIPTS"/get-distro.sh)" + if [ "$PACKAGE_TYPE" = 'tgz' ]; then PKG_SUFFIX="tar.gz" else - SYSTEM="$("$SCRIPTS"/get-distro.sh)" case "${SYSTEM:-}" in ubuntu*|debian*|raspbian*) PKG_SUFFIX='deb' @@ -149,7 +150,15 @@ emqx_test(){ ;; "rpm") # yum wants python2 - alternatives --list | grep python && alternatives --set python /usr/bin/python2 + case "${SYSTEM:-}" in + "el8") + # el8 is fine with python3 + true + ;; + *) + alternatives --list | grep python && alternatives --set python /usr/bin/python2 + ;; + esac YUM_RES=$(yum install -y "${PACKAGE_PATH}/${packagename}"| tee /dev/null) if [[ $YUM_RES =~ "Failed" ]]; then echo "yum install failed"