[DRE-commits] [diaspora-installer] 09/20: add db specific config

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Mon Mar 21 13:39:35 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 aeb98ec665f6f9ca59bd35c329b00c6e5fd21df7
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Mon Mar 21 14:51:55 2016 +0530

    add db specific config
---
 grantpriv.sh | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/grantpriv.sh b/grantpriv.sh
index db61e33..063f7a4 100755
--- a/grantpriv.sh
+++ b/grantpriv.sh
@@ -3,6 +3,23 @@
 user=diaspora
 dbname=diaspora_production
 
+. /etc/diaspora/diaspora-common.conf
+
+# Find out dbtype and run only for pgsql
+test -f /etc/dbconfig-common/diaspora-common.conf && . /etc/dbconfig-common/diaspora-common.conf
+
+if [ "$dbc_dbtype" = "mysql" ]; then
+  # Switch to mysql adapter, ugly hack, see #818863
+  sed -i 's/DB=postgres/DB=mysql/' ${diaspora_conf}
+  sed -i 's/\# <<: \*mysql/<<: \*mysql/' ${diaspora_database_yml}
+  sed -i 's/<<: \*postgres/\# <<: \*postgres/' ${diaspora_database_yml}
+  exit 0
+fi
+
+# Switch to postgres adapter, ugly hack, see #818863
+sed -i 's/<<: \*mysql/\# <<: \*mysql/' ${diaspora_database_yml}
+sed -i 's/\# <<: \*postgres/<<: \*postgres/' ${diaspora_database_yml}
+
 echo "Make $user user owner of $dbname database..."
 sudo -u postgres psql -c "ALTER DATABASE $dbname OWNER to $user;" || {
   exit 1 
@@ -16,5 +33,3 @@ echo "Grant all privileges to $user user..."
 sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE template1 to $user;" || {
   exit 1
   }
-
-

-- 
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