Browse code

Always install python3 and its dev package

Some distros do not install python3/python3-devel with the minimal
install. F29 doesn't install -devel, and neither Centos 7 or 8
install either. This patch ensures that these packages get installed.

Ideally, PYTHON3_VERSION would be set *after* ensuring that python3
was installed, but it gets a little tricky with all of the includes.
This sets it to 3.6 as nothing uses 3.5 anymore.

Change-Id: I7bdfc408b7c18273639ec26eade475856ac43593

Terry Wilson authored on 2019/10/16 04:45:09
Showing 3 changed files
... ...
@@ -463,6 +463,8 @@ function install_python3 {
463 463
         apt_get install python${PYTHON3_VERSION} python${PYTHON3_VERSION}-dev
464 464
     elif is_suse; then
465 465
         install_package python3-devel python3-dbm
466
+    elif is_fedora; then
467
+        install_package python3 python3-devel
466 468
     fi
467 469
 }
468 470
 
... ...
@@ -415,8 +415,11 @@ fi
415 415
 
416 416
 # Ensure python is installed
417 417
 # --------------------------
418
-is_package_installed python || install_package python
418
+install_python3
419 419
 
420
+if ! python3_enabled; then
421
+    is_package_installed python || install_package python
422
+fi
420 423
 
421 424
 # Configure Logging
422 425
 # -----------------
... ...
@@ -142,7 +142,7 @@ export USE_PYTHON3=$(trueorfalse True USE_PYTHON3)
142 142
 # version of Python 3 to this variable will install the app using that
143 143
 # version of the interpreter instead of 2.7.
144 144
 _DEFAULT_PYTHON3_VERSION="$(_get_python_version python3)"
145
-export PYTHON3_VERSION=${PYTHON3_VERSION:-${_DEFAULT_PYTHON3_VERSION:-3.5}}
145
+export PYTHON3_VERSION=${PYTHON3_VERSION:-${_DEFAULT_PYTHON3_VERSION:-3.6}}
146 146
 
147 147
 # Just to be more explicit on the Python 2 version to use.
148 148
 _DEFAULT_PYTHON2_VERSION="$(_get_python_version python2)"