Refactor pip check/install & add dependency for CentOS

Use easy_install to install pip to avoid additional dependencies
on CentOS. Refactor the check for an installed pip since it will
now be the same in both OS families.

env-setup.sh was missing a package required if the user is
starting from a very basic CentOS install.

Also fix a minor typo in the script.

Change-Id: I1ee783862b2bc5ad8b5df442ed7ca25732d8f706
This commit is contained in:
stephane 2015-06-15 15:09:21 -07:00
parent a06e974b8a
commit f239fe358f

View File

@ -5,20 +5,21 @@ if [ -x '/usr/bin/apt-get' ]; then
if ! $(git --version &>/dev/null) ; then
sudo -H apt-get -y install git
fi
if ! $(pip -v &>/dev/null); then
sudo easy_install pip
fi
elif [ -x '/usr/bin/yum' ]; then
if ! yum -q list installed python-devel; then
sudo -H yum -y install python-devel
fi
if ! $(git --version &>/dev/null); then
sudo -H yum -y install git
fi
if ! $(pip -v &>/dev/null); then
sudo -H yum -y install python-pip
fi
else
echo "ERROR: Supported package manager not found. Supported: apt,yum"
fi
if ! $(pip -v &>/dev/null); then
sudo easy_install pip
fi
sudo -E pip install -r "$(dirname $0)/../requirements.txt"
u=$(whoami)
@ -45,7 +46,7 @@ else
fi
echo
echo "If your using this script directly, execute the"
echo "If you're using this script directly, execute the"
echo "following commands to update your shell."
echo
echo "source env-vars"