summaryrefslogtreecommitdiff
path: root/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'update.sh')
-rwxr-xr-xupdate.sh96
1 files changed, 36 insertions, 60 deletions
diff --git a/update.sh b/update.sh
index 9eed6d17..3203d506 100755
--- a/update.sh
+++ b/update.sh
@@ -1,78 +1,54 @@
#!/bin/sh
-# Use this script to Download or Update all dependances to their last
+# Use this script to download or update all dependencies to their last
# developpement version.
-# The dependances will be placed in the sources directory, so you do not
+# 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
-error() {
- echo -e "\033[1;31mThe script failed to update $1.\033[0m"
- echo -e "\033[1;31mPlease investigate.\033[0m"
- exit 1
-}
+cd "$(dirname "$0")"
+VENV="poezio-venv"
+VENV_COMMAND="pyvenv"
echo 'Updating poezio'
-git pull origin master || error poezio
+git pull origin slix || {
+ echo "The script failed to update poezio."
+ exit 1
+}
-make
-if [ $? -ne 0 ]
+if [ -e "$VENV" ]
then
- echo -e "It seems that you do not have the python development"\
- "files.\nSearch for a package named python3-dev or python3-devel"\
- "in your repos."
- exit -1
-fi
+ # In case of a python version upgrade
+ echo 'Trying to upgrade the virtualenv'
+ $VENV_COMMAND --upgrade "$VENV"
+
+ . "$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"
+ $VENV_COMMAND "$VENV"
-if [ -e "SleekXMPP" ]
-then
- echo "Removing the old SleekXMPP"
- rm -rf SleekXMPP
- rm src/sleekxmpp
- git clone https://github.com/fritzy/SleekXMPP.git Sleek || error SleekXMPP
-fi
+ . "$VENV/bin/activate"
+ cd "$VENV" # needed to download slixmpp inside the venv
-if [ -e "Sleek" ]
-then
- echo "Updating SleekXMPP"
- cd Sleek
- git pull || error SleekXMPP
+ 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 ..
-else
- echo "Downloading SleekXMPP"
- git clone https://github.com/fritzy/SleekXMPP.git Sleek || error SleekXMPP
fi
-if [ -e ".dnspython.tgz" ]
-then
- if [ -e "dnspython" ]
- then
- echo "dnspython up to date"
- else
- echo "Restoring dnspython"
- tar xfz .dnspython.tgz
- mv dnspython3-1.10.0 dnspython
- fi
-else
- echo "Downloading dnspython"
- wget -c -q -O .dnspython.tgz http://www.dnspython.org/kits3/1.10.0/dnspython3-1.10.0.tar.gz || error dnspython
- rm -fr dnspython
- tar xfz .dnspython.tgz
- mv dnspython3-1.10.0 dnspython
-fi
+make
-cd src
-if [ -h "dns" ]
-then
- echo 'Link src/dns already exists'
-else
- echo "Creating link src/dns"
- ln -s ../dnspython/dns dns
-fi
-if [ -h "sleekxmpp" ]
+
+if [ -e src/slixmpp ]
then
- echo 'Link src/sleekxmpp already exists'
-else
- echo "Creating link src/sleekxmpp"
- ln -s ../Sleek/sleekxmpp sleekxmpp
+ 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