Optionally install all pip into a global venv.
This is useful for tracking what pip is causing to be
installed over and beyond os pacakges.
In support of this, move all package installation to before
the section where we install via pip. Leave the deferred configuration
until later though.
Change-Id: I89677fd54635e82b10ab674ddeb9ffb3f1a755f0
diff --git a/functions b/functions
index 46a6f8a..b66dc15 100644
--- a/functions
+++ b/functions
@@ -471,12 +471,19 @@
if [[ -z "$os_PACKAGE" ]]; then
GetOSVersion
fi
- if [[ "$os_PACKAGE" = "deb" ]]; then
- CMD_PIP=/usr/bin/pip
+ if [[ $TRACK_DEPENDS = True ]] ; then
+ source $DEST/.venv/bin/activate
+ CMD_PIP=$DEST/.venv/bin/pip
+ SUDO_PIP="env"
else
- CMD_PIP=/usr/bin/pip-python
+ SUDO_PIP="sudo"
+ if [[ "$os_PACKAGE" = "deb" ]]; then
+ CMD_PIP=/usr/bin/pip
+ else
+ CMD_PIP=/usr/bin/pip-python
+ fi
fi
- sudo PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \
+ $SUDO_PIP PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \
HTTP_PROXY=$http_proxy \
HTTPS_PROXY=$https_proxy \
$CMD_PIP install --use-mirrors $@
@@ -501,12 +508,17 @@
# develop, so that pip and not distutils process the dependency chain
# setup_develop directory
function setup_develop() {
+ if [[ $TRACK_DEPENDS = True ]] ; then
+ SUDO_CMD="env"
+ else
+ SUDO_CMD="sudo"
+ fi
(cd $1; \
python setup.py egg_info; \
raw_links=$(awk '/^.+/ {print "-f " $1}' *.egg-info/dependency_links.txt); \
depend_links=$(echo $raw_links | xargs); \
pip_install -r *-info/requires.txt $depend_links; \
- sudo \
+ $SUDO_CMD \
HTTP_PROXY=$http_proxy \
HTTPS_PROXY=$https_proxy \
python setup.py develop \