summaryrefslogtreecommitdiff
path: root/debian/python-django-ishtar.postinst
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-01-29 15:03:14 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-01-09 18:05:36 +0100
commitd4d9631e598288b2b9b5e8993219a66b4517a476 (patch)
tree0c7a2e5b82440c2be6dd85fc2cbfa31bb547d5a9 /debian/python-django-ishtar.postinst
parent40683c4dfd699ead8a24edec6a23d10f21a57363 (diff)
downloadIshtar-d4d9631e598288b2b9b5e8993219a66b4517a476.tar.bz2
Ishtar-d4d9631e598288b2b9b5e8993219a66b4517a476.zip
Work on new package
Diffstat (limited to 'debian/python-django-ishtar.postinst')
-rw-r--r--debian/python-django-ishtar.postinst70
1 files changed, 0 insertions, 70 deletions
diff --git a/debian/python-django-ishtar.postinst b/debian/python-django-ishtar.postinst
deleted file mode 100644
index 5efd25548..000000000
--- a/debian/python-django-ishtar.postinst
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/sh
-
-set -e
-set -x
-
-DATA_DIR=/var/lib/python-django-ishtar
-INSTANCES_FILE=$DATA_DIR/INSTANCES
-
-case "$1" in
- configure)
- instances="$( (cat $INSTANCES_FILE 2>/dev/null || true) | xargs )"
- if [ -n "$instances" ]; then
- echo "updading instances found in $INSTANCES_FILE: $instances"
- for instance in $instances; do
- # The upgrade procedure below was built from the "update"
- # target and its dependencies in the upstream Makefile:
- echo "updating $instance"
- cd $DATA_DIR/$instance
-
- # from "syncdb" target:
- python manage.py syncdb --noinput
- python manage.py migrate
-
- # from "compilemessages" target:
- #
- # NOTE: Instead of hardcoding an "apps" variable here, let's
- # look at candidates with find, and check whether each of
- # them indeed contains PO files as a second check:
- maybe_localized=$(cd $DATA_DIR; find -maxdepth 2 -name 'locale')
- for candidate in $maybe_localized; do
- if find $DATA_DIR/$candidate -name '*.po' >/dev/null 2>&1; then
- # Really looks like a valid app, let's strip the last
- # directory, cd into it, and compile messages using
- # the instance's manage.py script:
- app=${candidate%%/locale}
- (cd $DATA_DIR/$app; python $DATA_DIR/$instance/manage.py compilemessages)
- fi
- done
- # XXX: Doing this only once is likely sufficient, so
- # we could remember having performed that update while
- # taking care of the first instance, to avoid
- # extraneous reruns?
-
- # from "collectstatic" target:
- python manage.py collectstatic --noinput
-
- echo "updating $instance: OK"
- done
- echo "updating all instances: OK"
-
- # the assumption is that nginx and uwsgi were configured
- # through ishtar-prepare-instance, so let's restart them
- # unconditionally:
- invoke-rc.d uwsgi restart
- invoke-rc.d nginx restart
- echo "restarting uwsgi and nginx: OK"
- else
- echo "found no instances to upgrade in $INSTANCES_FILE"
- fi
- ;;
-
- abort-upgrade|abort-remove|abort-deconfigure)
-
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac