Merge "Remove extra if/then/else construct in pip element"

This commit is contained in:
Zuul 2022-02-09 05:19:36 +00:00 committed by Gerrit Code Review
commit f7c93fdca5

View File

@ -250,29 +250,27 @@ EOF
elif [[ $DISTRO_NAME = gentoo ]]; then
packages="dev-python/pip dev-python/virtualenv"
emerge -U $packages
elif [[ $DIB_RELEASE = bullseye ]]; then
packages="python3-pip python3-virtualenv"
apt-get -y install $packages
install_python3_pip
else
if [[ $DIB_RELEASE = bullseye ]]; then
packages="python3-pip python3-virtualenv"
apt-get -y install $packages
# pre-install packages so dependencies are there. We will
# overwrite with latest below.
packages="python-pip python-virtualenv"
# Unfortunately older ubuntu (trusty) doesn't have a
# python3-virtualenv package -- it seems it wasn't ready at the
# time and you had to use "python -m venv". Since then virtualenv
# has gained 3.4 support so the pip install below will work
if [[ ${DIB_PYTHON_VERSION} == 3 ]]; then
packages+=" python3-pip python3-virtualenv"
fi
apt-get -y install $packages
install_python2_pip
if [[ ${DIB_PYTHON_VERSION} == 3 ]]; then
install_python3_pip
else
# pre-install packages so dependencies are there. We will
# overwrite with latest below.
packages="python-pip python-virtualenv"
# Unfortunately older ubuntu (trusty) doesn't have a
# python3-virtualenv package -- it seems it wasn't ready at the
# time and you had to use "python -m venv". Since then virtualenv
# has gained 3.4 support so the pip install below will work
if [[ ${DIB_PYTHON_VERSION} == 3 ]]; then
packages+=" python3-pip python3-virtualenv"
fi
apt-get -y install $packages
install_python2_pip
if [[ ${DIB_PYTHON_VERSION} == 3 ]]; then
install_python3_pip
fi
fi
fi