diff options
author | André Fabian Silva Delgado <emulatorman@lavabit.com> | 2013-07-17 19:52:39 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@lavabit.com> | 2013-07-17 19:52:39 -0300 |
commit | acdbb84c92dc8962194e0a4d65fbe8afc6bace7c (patch) | |
tree | aad35466e3e7332a74bdcef93ddc17f7b057096b /libre/parabolaweb-utils/parabolaweb-update | |
parent | ea2c8211a376cb8e6dfc6359dc7c29b0ec408c2a (diff) | |
parent | 8d96e40155e6b47de074ccb1eb10e051b71c6752 (diff) |
Merge branch 'master' of ssh://projects.parabolagnulinux.org:1863/srv/git/abslibre
Diffstat (limited to 'libre/parabolaweb-utils/parabolaweb-update')
-rw-r--r-- | libre/parabolaweb-utils/parabolaweb-update | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/libre/parabolaweb-utils/parabolaweb-update b/libre/parabolaweb-utils/parabolaweb-update deleted file mode 100644 index 2da9eea8a..000000000 --- a/libre/parabolaweb-utils/parabolaweb-update +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -set -e - -. /etc/conf.d/parabolaweb -. /usr/bin/libremessages - -find_makefiles() { - pushd "$WEBDIR" > /dev/null - echo ./sitestatic - find . -name static -type d | while read dir; do - if [[ -e "$WEBDIR/$dir/Makefile" ]]; then - printf '%s\n' "$dir" - fi - done -} - -clean() { - cd "$WEBDIR" - msg "Purging old .pyc files..." - find . -name '*.pyc' -delete - msg "Purging old GNU Make generated files..." - for dir in `find_makefiles`; do - make -C "$WEBDIR/$dir" clean - done -} - -configure() { - cd "$WEBDIR" - msg "Checking configuration..." - if [[ ! -f local_settings.py ]]; then - msg2 "Configuration file missing, opening editor..." - cp local_settings.py.example local_settings.tmp.$$.py - if "$EDITOR" 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 - msg2 "Creating database..." - ./manage.py syncdb - else - msg2 "Current configuration checks out" - fi -} - -update-database() { - cd "$WEBDIR" - msg "Updating database..." - msg2 "Running migrations..." - ./manage.py migrate - if [[ -f devel/management/commands/update_types_permissions.py ]]; then - msg2 "Updating permissions..." - ./manage.py update_types_permissions - fi - msg2 "Loading fixtures..." - ./manage.py loaddata */fixtures/*.json -} - -update-filesystem() { - msg "Updating filesystem..." - for dir in `find_makefiles`; do - msg2 "Updating $dir with GNU Make..." - make -C "$WEBDIR/$dir" - done - cd "$WEBDIR" - msg2 "Collecting static files..." - echo yes | ./manage.py collectstatic -l -} - -main() { - if [[ -z "$EDITOR" ]]; then - error 'Please set the $EDITOR variable' - exit 1 - fi - - if [[ -d "$WEBDIR" ]]; then - clean - fi - parabolaweb-download - configure - update-database - update-filesystem -} - -main "$@" |