From bf7d15277f3712ddf60da448df7cfe0c7f6ceb69 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 7 Jun 2019 11:20:04 +0200 Subject: [PATCH] build-from-source: prefer python2 on RHEL 7 On RHEL 7.7 python3 is available but doesn't have gobject-introspection. --- contrib/rh-bkr/build-from-source.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/contrib/rh-bkr/build-from-source.sh b/contrib/rh-bkr/build-from-source.sh index 386edffd6c..ffaf29f156 100755 --- a/contrib/rh-bkr/build-from-source.sh +++ b/contrib/rh-bkr/build-from-source.sh @@ -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"