Merge "Sync tools/tox_install.sh"

This commit is contained in:
Jenkins 2016-08-31 17:17:39 +00:00 committed by Gerrit Code Review
commit aa4424c95e
1 changed files with 34 additions and 34 deletions

View File

@ -17,9 +17,8 @@ CONSTRAINTS_FILE=$1
shift
install_cmd="pip install"
if [[ $CONSTRAINTS_FILE != "unconstrained" ]]; then
mydir=$(mktemp -dt "$PACKAGE_NAME-tox_install-XXXXXXX")
trap "rm -rf $mydir" EXIT
localfile=$mydir/upper-constraints.txt
if [[ $CONSTRAINTS_FILE != http* ]]; then
CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE
@ -31,7 +30,6 @@ if [[ $CONSTRAINTS_FILE != "unconstrained" ]]; then
echo "ALREADY INSTALLED" > /tmp/tox_install.txt
echo "Requirements already installed; using existing package"
elif [ -x "$ZUUL_CLONER" ]; then
export ZUUL_BRANCH=${ZUUL_BRANCH-$BRANCH}
echo "ZUUL CLONER" > /tmp/tox_install.txt
pushd $mydir
$ZUUL_CLONER --cache-dir \
@ -50,8 +48,10 @@ if [[ $CONSTRAINTS_FILE != "unconstrained" ]]; then
$install_cmd -U -e ${REQUIREMENTS_PIP_LOCATION}
fi
# This is the main purpose of the script: Allow local installation of
# the current repo. It is listed in constraints file and thus any
# install will be constrained and we need to unconstrain it.
edit-constraints $localfile -- $PACKAGE_NAME "-e file://$PWD#egg=$PACKAGE_NAME"
fi
$install_cmd -U $*
exit $?