From 82d95f050dbe18576daf36e953d9c2e01330e517 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 9 Apr 2014 15:45:33 +0100 Subject: Fix formatting of compact-xapian-database --- script/compact-xapian-database | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'script/compact-xapian-database') diff --git a/script/compact-xapian-database b/script/compact-xapian-database index f16c4ca37..075a71cd8 100755 --- a/script/compact-xapian-database +++ b/script/compact-xapian-database @@ -5,23 +5,26 @@ set -e cd "$(dirname "$0")"/.. -if [ -x /usr/bin/xapian-compact ]; then +if [ -x /usr/bin/xapian-compact ]; + then XAPIAN_DB_DIR=$( pwd )/lib/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" <&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" <&2 "Could not find xapian-compact script; have you installed xapian-tools?" exit 1 fi -- cgit v1.2.3