poezio/update.sh
mathieui d98f2dde25
Make update.sh install the deps in a venv, and use them
simplifies the script and avoid cluttering the poezio/ directory.

also fix an unrelated test with slixmpp
2014-11-02 20:08:31 +01:00

43 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
# Use this script to download or update all dependencies to their last
# developpement version.
# The dependencies will be located in a virtualenv, so you do not
# need to install them on your system at all.
# Use launch.sh to start poezio directly from here
cd "$(dirname "$0")"
VENV="poezio-venv"
echo 'Updating poezio'
git pull origin slix || {
echo "The script failed to update poezio."
exit 1
}
if [ -e "$VENV" ]
then
# In case of a python version upgrade
echo 'Trying to upgrade the virtualenv'
pyvenv --upgrade "$VENV"
source "$VENV/bin/activate"
echo 'Updating the poezio dependencies'
pip install -r requirements.txt --upgrade
echo 'Updating the poezio plugin dependencies'
pip install -r requirements-plugins.txt --upgrade
else
echo "Creating the $VENV virtualenv"
pyvenv "$VENV"
source "$VENV/bin/activate"
cd "$VENV" # needed to download slixmpp inside the venv
echo 'Installing the poezio dependencies using pip'
pip install -r "../requirements.txt"
echo 'Installing the poezio plugin dependencies using pip'
pip install -r "../requirements-plugins.txt"
cd ..
fi
make