update.sh 1.45 KB
Newer Older
1
#!/bin/sh
2
# Use this script to download or update all dependencies to their last
3
# developpement version.
4
# The dependencies will be located in a virtualenv, so you do not
5 6 7 8
# need to install them on your system at all.

# Use launch.sh to start poezio directly from here

9 10
cd "$(dirname "$0")"
VENV="poezio-venv"
mathieui's avatar
mathieui committed
11
VENV_COMMAND="pyvenv"
12

13
echo 'Updating poezio'
14
git pull origin master || {
15 16 17
    echo "The script failed to update poezio."
    exit 1
}
18

19
if [ -e "$VENV" ]
mathieui's avatar
mathieui committed
20
then
21 22
    # In case of a python version upgrade
    echo 'Trying to upgrade the virtualenv'
mathieui's avatar
mathieui committed
23
    $VENV_COMMAND --upgrade "$VENV"
mathieui's avatar
mathieui committed
24

mathieui's avatar
mathieui committed
25
    . "$VENV/bin/activate"
26 27 28 29
    echo 'Updating the poezio dependencies'
    pip install -r requirements.txt --upgrade
    echo 'Updating the poezio plugin dependencies'
    pip install -r requirements-plugins.txt --upgrade
30
else
31
    echo "Creating the $VENV virtualenv"
mathieui's avatar
mathieui committed
32
    $VENV_COMMAND "$VENV"
mathieui's avatar
mathieui committed
33

mathieui's avatar
mathieui committed
34
    . "$VENV/bin/activate"
35
    cd "$VENV" # needed to download slixmpp inside the venv
36

37 38 39 40 41
    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 ..
42
fi
43 44

make
45 46 47 48 49 50 51 52 53 54


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