2012-10-03 21:51:05 +00:00
|
|
|
#!/bin/sh
|
2014-11-02 19:06:16 +00:00
|
|
|
# Use this script to download or update all dependencies to their last
|
2011-04-15 23:28:37 +00:00
|
|
|
# developpement version.
|
2014-11-02 19:06:16 +00:00
|
|
|
# The dependencies will be located in a virtualenv, so you do not
|
2011-04-15 23:28:37 +00:00
|
|
|
# need to install them on your system at all.
|
|
|
|
|
|
|
|
# Use launch.sh to start poezio directly from here
|
|
|
|
|
2014-11-02 19:06:16 +00:00
|
|
|
cd "$(dirname "$0")"
|
2015-01-15 15:46:51 +00:00
|
|
|
if [ -z "$POEZIO_VENV" ]
|
|
|
|
then
|
|
|
|
POEZIO_VENV="poezio-venv"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$POEZIO_VENV_COMMAND" ]
|
|
|
|
then
|
|
|
|
POEZIO_VENV_COMMAND="pyvenv"
|
|
|
|
fi
|
2015-01-24 17:00:48 +00:00
|
|
|
command -v $POEZIO_VENV_COMMAND > /dev/null 2>&1 || {
|
|
|
|
echo "'$POEZIO_VENV_COMMAND' executable not found. Check that you have python (>= 3.4) installed,"
|
|
|
|
echo " and that \$POEZIO_VENV_COMMAND points to a valid virtualenv command."
|
|
|
|
if [ "$POEZIO_VENV_COMMAND" = 'pyvenv' ]; then
|
|
|
|
echo "If your distribution does not provide a 'pyvenv' command, maybe it has another name, like 'pyvenv-3.4'"
|
|
|
|
echo 'Set the $POEZIO_VENV_COMMAND env variable to the name of that executable and this script will use it.'
|
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
}
|
2013-03-06 22:15:23 +00:00
|
|
|
|
2011-04-15 23:28:37 +00:00
|
|
|
echo 'Updating poezio'
|
2014-11-29 16:36:38 +00:00
|
|
|
git pull origin master || {
|
2014-11-02 19:06:16 +00:00
|
|
|
echo "The script failed to update poezio."
|
|
|
|
exit 1
|
|
|
|
}
|
2011-04-13 00:14:35 +00:00
|
|
|
|
2015-01-15 15:46:51 +00:00
|
|
|
if [ -e "$POEZIO_VENV" ]
|
2011-11-08 01:31:44 +00:00
|
|
|
then
|
2014-11-02 19:06:16 +00:00
|
|
|
# In case of a python version upgrade
|
|
|
|
echo 'Trying to upgrade the virtualenv'
|
2015-01-15 15:46:51 +00:00
|
|
|
$POEZIO_VENV_COMMAND --upgrade "$POEZIO_VENV"
|
2015-09-04 23:46:25 +00:00
|
|
|
$POEZIO_VENV_COMMAND --system-site-packages "$POEZIO_VENV"
|
2011-11-08 01:31:44 +00:00
|
|
|
|
2015-01-15 15:46:51 +00:00
|
|
|
. "$POEZIO_VENV/bin/activate"
|
2015-05-21 08:06:03 +00:00
|
|
|
echo 'Updating the in-venv pip'
|
|
|
|
pip install --upgrade pip
|
2014-12-15 15:24:21 +00:00
|
|
|
python3 -c 'import sys;(print("Python 3.4 or newer is required") and exit(1)) if sys.version_info < (3, 4) else exit(0)' || exit 1
|
2014-11-02 19:06:16 +00:00
|
|
|
echo 'Updating the poezio dependencies'
|
|
|
|
pip install -r requirements.txt --upgrade
|
|
|
|
echo 'Updating the poezio plugin dependencies'
|
|
|
|
pip install -r requirements-plugins.txt --upgrade
|
2011-04-13 00:14:35 +00:00
|
|
|
else
|
2015-01-15 15:46:51 +00:00
|
|
|
echo "Creating the $POEZIO_VENV virtualenv"
|
|
|
|
$POEZIO_VENV_COMMAND "$POEZIO_VENV"
|
2015-09-04 23:46:25 +00:00
|
|
|
$POEZIO_VENV_COMMAND --system-site-packages "$POEZIO_VENV"
|
2013-01-17 16:37:06 +00:00
|
|
|
|
2015-01-15 15:46:51 +00:00
|
|
|
. "$POEZIO_VENV/bin/activate"
|
|
|
|
cd "$POEZIO_VENV" # needed to download slixmpp inside the venv
|
2014-12-15 15:24:21 +00:00
|
|
|
python3 -c 'import sys;(print("Python 3.4 or newer is required") and exit(1)) if sys.version_info < (3, 4) else exit(0)' || exit 1
|
2011-04-13 00:14:35 +00:00
|
|
|
|
2014-11-02 19:06:16 +00:00
|
|
|
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 ..
|
2011-04-13 00:14:35 +00:00
|
|
|
fi
|
2014-11-02 19:06:16 +00:00
|
|
|
|
|
|
|
make
|
2014-11-12 20:34:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
if [ -e src/slixmpp ]
|
|
|
|
then
|
|
|
|
echo ""
|
|
|
|
echo "The update script detected a slixmpp link in src/."
|
|
|
|
echo "This is probably due to the old update script, you should delete it"
|
|
|
|
echo "so that poezio can use the up-to-date copy inside the poezio-venv directory."
|
|
|
|
echo ""
|
|
|
|
fi
|