diff options
Diffstat (limited to 'script')
-rwxr-xr-x | script/compact-xapian-database | 25 | ||||
-rwxr-xr-x | script/generate_pot.sh | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/script/compact-xapian-database b/script/compact-xapian-database new file mode 100755 index 000000000..f1a6058b0 --- /dev/null +++ b/script/compact-xapian-database @@ -0,0 +1,25 @@ +#!/bin/bash + +export RAILS_ENV=$1 +set -e + +if [ -x /usr/bin/xapian-compact ]; then + XAPIAN_DB_DIR=$( cd "$( dirname "$0" )" && pwd )/../vendor/plugins/acts_as_xapian/xapiandbs + if [ -e "$XAPIAN_DB_DIR/$RAILS_ENV.new" ]; then + echo >&2 "Didn't compact Xapian database because there was an existing database at $XAPIAN_DB_DIR/$RAILS_ENV.new" + exit 1 + else + OWNER=$(stat -c %U "$XAPIAN_DB_DIR/$RAILS_ENV") + export XAPIAN_DB_DIR RAILS_ENV + su "$OWNER" <<SU + xapian-compact "\$XAPIAN_DB_DIR/\$RAILS_ENV" "\$XAPIAN_DB_DIR/\$RAILS_ENV.new" +SU + mv "$XAPIAN_DB_DIR/$RAILS_ENV" "$XAPIAN_DB_DIR/$RAILS_ENV.tmp" + mv "$XAPIAN_DB_DIR/$RAILS_ENV.new" "$XAPIAN_DB_DIR/$RAILS_ENV" + rm -rf "$XAPIAN_DB_DIR/$RAILS_ENV.tmp" + /etc/init.d/apache2 restart + fi +else + echo >&2 "Could not find xapian-compact script; have you installed xapian-tools?" + exit 1 +fi diff --git a/script/generate_pot.sh b/script/generate_pot.sh index ca81b0ded..287d33e7f 100755 --- a/script/generate_pot.sh +++ b/script/generate_pot.sh @@ -4,3 +4,5 @@ cd `dirname $0` rake gettext:store_model_attributes rake gettext:find +git checkout ../locale/*/app.po + |