From ab89c7d69c6bba6a6e394ff7a4ae520268bb2b16 Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Mon, 13 Nov 2017 22:58:56 +0000 Subject: [PATCH] Dont install python-pip for py3k We want to install python3-pip, not python-pip when we are building a py3k image less we pull in python2. Once we stop installing python2 we have to stop calling python2 during pip install. Change-Id: I7d8ba9300039cce90965410a4e16ca9e711904c3 --- .../04-install-pip | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip b/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip index 3e8638310..10872370d 100755 --- a/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip +++ b/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip @@ -112,7 +112,7 @@ else # 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=$(echo "$packages" | sed s/python-virtualenv/python3-virtualenv/) + packages=$(echo "$packages" | sed s/python-virtualenv/python3-virtualenv/ | sed s/python-pip/python3-pip/) fi apt-get -y install $packages @@ -123,9 +123,12 @@ else # These install into /usr/local/bin so override any packages, even # if installed later. - python3 /tmp/get-pip.py $pip_args - python2 /tmp/get-pip.py $pip_args + if [[ ${DIB_PYTHON_VERSION} == 3 ]]; then + python3 /tmp/get-pip.py $pip_args + pip3 install $pip_args virtualenv + else + python2 /tmp/get-pip.py $pip_args + pip install $pip_args virtualenv + fi - pip3 install $pip_args virtualenv - pip install $pip_args virtualenv fi