From 0b58a05ac6bcabb8d5dc65a32e1526df4e0251e5 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Tue, 7 Jul 2020 11:41:00 +0200 Subject: [PATCH] Do not use 'sudo pip install' when venv is used We end up installing bindep and bifrost deps in the system otherwise. Change-Id: I3d3b24ba5313013051e8b18d1ce4ec42a61d20f0 --- scripts/install-deps.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index b9323b231..cdfa94a8b 100755 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -124,13 +124,21 @@ if [ -n "${VENV-}" ]; then fi # Install the rest of required packages using bindep -sudo -H -E ${PIP} install bindep +if [ -n "${VENV-}" ]; then + ${PIP} install bindep +else + sudo -H -E ${PIP} install bindep +fi echo "Using Bindep to install binary dependencies..." # bindep returns 1 if packages are missing bindep -b &> /dev/null || ${INSTALLER_CMD} $(bindep -b) echo "Installing Python requirements" -sudo -H -E ${PIP} install -r "$(dirname $0)/../requirements.txt" +if [ -n "${VENV-}" ]; then + ${PIP} install -r "$(dirname $0)/../requirements.txt" +else + sudo -H -E ${PIP} install -r "$(dirname $0)/../requirements.txt" +fi echo "Completed installation of basic dependencies."