From a30dd1cc96a75d565ae924e4698c4208150e5564 Mon Sep 17 00:00:00 2001 From: Lenny Verkhovsky Date: Thu, 14 Mar 2019 13:19:36 +0200 Subject: [PATCH] Fixed support python 2 on Fedora 27 I7d16194d6ba1391ca31251d5b50cbb8de033fc38 added wrong behavour on Fedora > 26 and Centos 7 when python3 disabled pip should install packages in /usr/bin Closes-Bug: #1820070 Change-Id: I3a8efbc8eb6e311db9c7347577c5d2047ba523a9 --- inc/python | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/inc/python b/inc/python index 419d5c5701..ba2048dd84 100644 --- a/inc/python +++ b/inc/python @@ -49,16 +49,9 @@ function get_python_exec_prefix { fi $xtrace - if python3_enabled && [[ "$os_VENDOR" == "CentOS" ]] || \ - [[ "$os_VENDOR" == "Fedora" && $os_RELEASE -gt 26 ]]; then - # Default Python 3 install prefix changed to /usr/local in Fedora 27: - # https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe - echo "/usr/local/bin" - elif is_fedora || is_suse; then - echo "/usr/bin" - else - echo "/usr/local/bin" - fi + local PYTHON_PATH=/usr/local/bin + ( is_fedora && ! python3_enabled ) || is_suse && PYTHON_PATH=/usr/bin + echo $PYTHON_PATH } # Wrapper for ``pip install`` that only installs versions of libraries