[ADD] DCOS-2301 pip version check to install script

This commit is contained in:
ytalashko
2015-08-11 16:22:05 +03:00
parent 2f028c204c
commit 4173ccacec
2 changed files with 24 additions and 0 deletions

View File

@@ -7,11 +7,26 @@ usage()
echo "$(basename "$(test -L "$0" && readlink "$0" || echo "$0")") <installation-path> <dcos-url>" echo "$(basename "$(test -L "$0" && readlink "$0" || echo "$0")") <installation-path> <dcos-url>"
} }
check_pip_version()
{
PIP_INFO=$(pip -V);
REGEX="([0-9]+)\.([0-9]+)";
[[ $PIP_INFO =~ $REGEX ]];
MAJOR_PIP_VERSION="${BASH_REMATCH[1]}";
MINOR_PIP_VERSION="${BASH_REMATCH[2]}";
if [ "$MAJOR_PIP_VERSION" -lt 1 ] || ([ "$MAJOR_PIP_VERSION" -eq 1 ] && [ "$MINOR_PIP_VERSION" -le 4 ]);
then echo "Pip version must be greater than 1.4. Aborting.";
exit 1;
fi
}
if [ "$#" -lt 2 ]; then if [ "$#" -lt 2 ]; then
usage; usage;
exit 1; exit 1;
fi fi
check_pip_version;
ARGS=( "$@" ); ARGS=( "$@" );
VIRTUAL_ENV_PATH=$(python -c "import os; print(os.path.realpath('"${ARGS[0]}"'))") VIRTUAL_ENV_PATH=$(python -c "import os; print(os.path.realpath('"${ARGS[0]}"'))")

View File

@@ -29,6 +29,15 @@ if (-Not(Get-Command pip -errorAction SilentlyContinue))
exit 1 exit 1
} }
$PIP_VERSION = (pip -V)
"$PIP_VERSION" -match "[0-9]+\.[0-9]+"
if ([double]$matches[0] -le 1.4) {
echo "Pip version must be greater than 1.4. Aborting."
exit 1
}
if (-Not(Get-Command virtualenv -errorAction SilentlyContinue)) if (-Not(Get-Command virtualenv -errorAction SilentlyContinue))
{ {
echo "The program 'virtualenv' could not be found. Make sure that it has been installed with the 'pip' Python package program." echo "The program 'virtualenv' could not be found. Make sure that it has been installed with the 'pip' Python package program."