Commit 0837e994 authored by Carlos Ramos Carreño's avatar Carlos Ramos Carreño

Allow pip to be installed in Suse SLE 15.6

In Suse SLE 15.6, ansible can be installed either from the OpenSuse
repo of from PackageHub.

The version installed from OpenSuse requires Python >= 3.10.
Thus, it depends on the modern Python (version 3.11) provided by the
Python 3 module, instead of on the Python provided by the base system
module (version 3.6).
Packages installed for the modern Python, such as pip, will have
python311 as a prefix instead of just Python.

On the other hand, the ansible version in PackageHub is older and
can be used with the older Python version.

Thus, we check if either version of the package is installed, and if
not we install the more modern from those available.

See merge request nexedi/slapos.core!647.
parent f866e7a1
...@@ -55,7 +55,13 @@ is_package_installed unzip || install_package unzip ...@@ -55,7 +55,13 @@ is_package_installed unzip || install_package unzip
is_package_installed openssl || install_package openssl is_package_installed openssl || install_package openssl
is_package_installed ansible || install_package ansible is_package_installed ansible || install_package ansible
if ! is_ubuntu || [[ $DISTRO = wheezy || $DISTRO == jessie || $DISTRO == stretch || $DISTRO == xenial || $DISTRO == bionic ]]; then if [[ $DISTRO = sle15.6 ]]; then
# Python 3.11 is in a separate module, called Python 3, while the base system has Python 3.6.
# If the Python 3 module is enabled, we assume that the user has preference for it.
# Otherwise, we install the base packages.
is_package_installed python311-pip || is_package_installed python3-pip || install_package python311-pip || install_package python3-pip
pip3 install --upgrade pip
elif ! is_ubuntu || [[ $DISTRO = wheezy || $DISTRO == jessie || $DISTRO == stretch || $DISTRO == xenial || $DISTRO == bionic ]]; then
is_package_installed python-pip || install_package python-pip is_package_installed python-pip || install_package python-pip
pip install --upgrade "pip < 21.0" pip install --upgrade "pip < 21.0"
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment