From 7ae55fdc9e3196978773be6289573f9dddf6fe50 Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Sun, 26 Jan 2014 16:21:14 +0000 Subject: [PATCH] Added more robust check for pip and virtualenv --- distribute.sh | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/distribute.sh b/distribute.sh index 3b898f6233..9c66d12c80 100755 --- a/distribute.sh +++ b/distribute.sh @@ -18,6 +18,30 @@ if [ "X$PYTHON" == "X" ]; then PYTHON="$(which python)" fi +# Resolve pip path +PIP_NAME="$(which pip-2.7)" +if [ "X$PIP_NAME" == "X" ]; then + PIP_NAME="$(which pip2.7)" +fi +if [ "X$PIP_NAME" == "X" ]; then + PIP_NAME="$(which pip2)" +fi +if [ "X$PIP_NAME" == "X" ]; then + PIP_NAME="$(which pip)" +fi + +# Resolve virtualenv path +VIRTUALENV_NAME="$(which virtualenv-2.7)" +if [ "X$VIRTUALENV_NAME" == "X" ]; then + VIRTUALENV_NAME="$(which virtualenv2.7)" +fi +if [ "X$VIRTUALENV_NAME" == "X" ]; then + VIRTUALENV_NAME="$(which virtualenv2)" +fi +if [ "X$VIRTUALENV_NAME" == "X" ]; then + VIRTUALENV_NAME="$(which virtualenv)" +fi + # Paths ROOT_PATH="$(dirname $($PYTHON -c 'from __future__ import print_function; import os,sys;print(os.path.realpath(sys.argv[1]))' $0))" RECIPES_PATH="$ROOT_PATH/recipes" @@ -35,7 +59,8 @@ HOSTPYTHON="$BUILD_PATH/python-install/bin/python.host" export LIBLINK_PATH="$BUILD_PATH/objects" export LIBLINK="$ROOT_PATH/src/tools/liblink" export BIGLINK="$ROOT_PATH/src/tools/biglink" -export PIP="pip-2.7" +export PIP=$PIP_NAME +export VIRTUALENV=$VIRTUALENV_NAME MD5SUM=$(which md5sum) if [ "X$MD5SUM" == "X" ]; then