Resolve circular dependency when tracking dependencies.

When TRACK_DEPENDS=True, there is a circular dependency wherein virtualenv is
used to install virtualenv before a virtualenv has been established.
TRACK_DEPENDS does not work in any use case without this fix.

Change-Id: I7a6652ba091cb95dac3871b6c71edcd762a7be62
Closes-Bug: 1208867
This commit is contained in:
Robbie Harwood (frozencemetery) 2014-07-31 13:55:06 -04:00
parent 307cfcb9d1
commit 1229a0879f

View File

@ -1328,7 +1328,10 @@ function pip_install {
if [[ -z "$os_PACKAGE" ]]; then
GetOSVersion
fi
if [[ $TRACK_DEPENDS = True ]]; then
if [[ $TRACK_DEPENDS = True && ! "$@" =~ virtualenv ]]; then
# TRACK_DEPENDS=True installation creates a circular dependency when
# we attempt to install virtualenv into a virualenv, so we must global
# that installation.
source $DEST/.venv/bin/activate
CMD_PIP=$DEST/.venv/bin/pip
SUDO_PIP="env"