[DRE-commits] [diaspora-installer] 02/04: create DB_NAME variable
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Sun Aug 28 19:29:07 UTC 2016
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository diaspora-installer.
commit 169501c4eb1e711fb47b5368fbd0d628ca30d333
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Mon Aug 29 00:40:23 2016 +0530
create DB_NAME variable
---
debian/postinst | 6 +++---
diaspora.conf | 1 +
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/debian/postinst b/debian/postinst
index 8688fa2..1d8d628 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -28,10 +28,10 @@ set -e
check_db_status() {
echo "Checking if the database is empty..."
if [ "$DB" = "postgres" ]; then
- test "$(LANG=C su postgres -c "psql diaspora_production -c \"\d\"")" = \
+ test "$(LANG=C su postgres -c "psql ${DB_NAME} -c \"\d\"")" = \
"No relations found."
else
- test -z "$(sudo mysql --defaults-file=/etc/mysql/debian.cnf -e "show tables from diaspora_production")"
+ test -z "$(sudo mysql --defaults-file=/etc/mysql/debian.cnf -e "show tables from ${DB_NAME}")"
fi
}
@@ -45,7 +45,7 @@ case "$1" in
cd ${diaspora_home}
echo "Setting up environment varibales..."
. /usr/lib/diaspora-common/scripts/set-env-diaspora.sh
- export RAILS_ENV=$RAILS_ENV BUNDLE_WITH=${BUNDLE_WITH} ENVIRONMENT_URL=$ENVIRONMENT_URL
+ export RAILS_ENV=$RAILS_ENV BUNDLE_WITH=${BUNDLE_WITH} DB_NAME=${DB_NAME} ENVIRONMENT_URL=$ENVIRONMENT_URL
echo "Installing latest version of bundler..."
gem install bundler
diff --git a/diaspora.conf b/diaspora.conf
index 925c724..b021d6c 100644
--- a/diaspora.conf
+++ b/diaspora.conf
@@ -1,3 +1,4 @@
export RAILS_ENV=production
export DB=postgres
export BUNDLE_WITH=postgresql
+export DB_NAME=diaspora_production
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/diaspora-installer.git
More information about the Pkg-ruby-extras-commits
mailing list