build-from-source: prefer python2 on RHEL 7

On RHEL 7.7 python3 is available but doesn't have gobject-introspection.
This commit is contained in:
Beniamino Galvani 2019-06-07 11:20:04 +02:00
parent 794b2ba24e
commit bf7d15277f

View file

@ -78,11 +78,15 @@ $SUDO yum install \
# for the tests, let's pre-load some modules:
$SUDO modprobe ip_gre
# in particular on rhel-8, the pygobject module does not exist for
# python2. Hence, we prefer python3 over python2.
PYTHON=$(which python3) || \
PYTHON=$(which python2) || \
PYTHON=$(which python)
if grep -q Maipo /etc/redhat-release; then
PYTHON=$(which python2)
else
# in particular on rhel-8, the pygobject module does not exist for
# python2. Hence, we prefer python3 over python2.
PYTHON=$(which python3) || \
PYTHON=$(which python2) || \
PYTHON=$(which python)
fi
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"