summaryrefslogtreecommitdiff
path: root/libre/parabolaweb-git/parabolaweb.update.sh.in
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2012-05-31 13:59:08 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2012-05-31 13:59:08 -0300
commitca4b95e91b33e5b8f02a063862359ab00c5260d5 (patch)
tree872d6a54fa0e59e017aa3101880d82f0e54fb70a /libre/parabolaweb-git/parabolaweb.update.sh.in
parent041ebdb9062909e39f81cca8c491c7f8adeed2a3 (diff)
parent2ed96c6eb798c762b61a93a8b4cf80220c00ac1f (diff)
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts: community-testing/libvirt/PKGBUILD community/opendkim/opendkim.rc core/nfs-utils/blkmapd.service multilib/lib32-glib2/PKGBUILD multilib/lib32-libssh2/PKGBUILD multilib/lib32-libx11/PKGBUILD multilib/lib32-qt/PKGBUILD testing/php/PKGBUILD testing/xorg-server/PKGBUILD ~fauno/notmuch/PKGBUILD
Diffstat (limited to 'libre/parabolaweb-git/parabolaweb.update.sh.in')
-rw-r--r--libre/parabolaweb-git/parabolaweb.update.sh.in59
1 files changed, 59 insertions, 0 deletions
diff --git a/libre/parabolaweb-git/parabolaweb.update.sh.in b/libre/parabolaweb-git/parabolaweb.update.sh.in
new file mode 100644
index 000000000..8c3aef0f0
--- /dev/null
+++ b/libre/parabolaweb-git/parabolaweb.update.sh.in
@@ -0,0 +1,59 @@
+#!/bin/sh
+set -e
+
+_install_dir=@INSTALL_DIR@
+_gitname=@GIT_NAME@
+
+_gitroot=@GITROOT@
+_gitbranch=@GITBRANCH@
+
+. /usr/bin/libremessages
+
+if [ ! -d "$_install_dir" ]; then
+ mkdir "$_install_dir"
+fi
+cd "$_install_dir"
+
+msg "Connecting to GIT server...."
+if [ -d ${_gitname} ] ; then
+ msg2 "Updating existing tree"
+ cd ${_gitname} && git pull ${_gitroot}
+else
+ msg2 "Cloning tree"
+ git clone ${_gitroot} ${_gitname}
+ cd ${_gitname}
+fi
+git checkout ${_gitbranch}
+msg "GIT checkout done or server timeout"
+
+msg "Purging old .pyc files...."
+find . -name '*.pyc' -delete
+
+msg "Checking configuration...."
+if [ ! -f local_settings.py ]; then
+ cp local_settings.py.example local_settings.tmp.$$.py
+ if ${EDITOR:-xdg-open} local_settings.tmp.$$.py; then
+ mv local_settings.tmp.$$.py local_settings.py
+ else
+ rm local_settings.tmp.$$.py
+ msg "Failed to configure, exiting"
+ exit 1
+ fi
+ msg "Creating database...."
+ ./manage.py syncdb
+fi
+
+msg "Purging old .pyc files...."
+find . -name '*.pyc' -delete
+
+msg "Updating database...."
+msg2 "Running migrations...."
+./manage.py migrate
+msg2 "Loading fixtures...."
+./manage.py loaddata */fixtures/*.json
+
+msg "Checking media/admin_media symlink...."
+if [ ! -e media/admin-media ]; then
+ rm media/admin_media
+ ln -s /usr/lib/python2.7/site-packages/django/contrib/admin/media media/admin_media
+fi