summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-06-07 11:20:04 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2019-06-07 11:22:11 +0200
commitbf7d15277f3712ddf60da448df7cfe0c7f6ceb69 (patch)
tree6d5b64d766f73c8fb07c4ce70a529e4aa712d49b
parent794b2ba24e4641bb8b22ed543991f9e14ba4e1f1 (diff)
downloadNetworkManager-bf7d15277f3712ddf60da448df7cfe0c7f6ceb69.tar.gz
build-from-source: prefer python2 on RHEL 7
On RHEL 7.7 python3 is available but doesn't have gobject-introspection.
-rwxr-xr-xcontrib/rh-bkr/build-from-source.sh14
1 files 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"