[Git][noosfero/noosfero][cherry-pick-62193d8b] Merge branch 'noosfero-chat-db-dependency' into 'master'

Rodrigo Souto gitlab at mg.gitlab.com
Mon May 2 17:37:56 BRT 2016


Rodrigo Souto pushed to branch cherry-pick-62193d8b at Noosfero / noosfero


Commits:
bfb6dcbf by Rodrigo Souto at 2016-05-02T20:37:50+00:00
Merge branch 'noosfero-chat-db-dependency' into 'master'

noosfero-chat: avoid psql command if postgresql is not installed



See merge request !830
- - - - -


1 changed file:

- debian/noosfero-chat.postinst


Changes:

=====================================
debian/noosfero-chat.postinst
=====================================
--- a/debian/noosfero-chat.postinst
+++ b/debian/noosfero-chat.postinst
@@ -21,10 +21,17 @@ echo " [database = $noosfero_database]"
 echo 'Creating ejabberd schema ...'
 . /etc/default/noosfero
 noosfero_user="$NOOSFERO_USER"
-su - postgres -c "psql -c 'GRANT CREATE ON DATABASE $noosfero_database TO $noosfero_user;' > /dev/null"
+
+if dpkg -s postgresql &> /dev/null ; then
+  su - postgres -c "psql -c 'GRANT CREATE ON DATABASE $noosfero_database TO $noosfero_user;' > /dev/null"
+else
+  echo "[W]: No postgres installed. You're probably using noosfero's database in another machine. Make sure user $noosfero_user has CREATE permissions on $noosfero_database database by running:"
+  echo " => GRANT CREATE ON DATABASE $noosfero_database TO $noosfero_user;"
+fi
+
 su - $noosfero_user -c 'rails dbconsole production < /usr/share/noosfero/util/chat/postgresql/ejabberd.sql > /dev/null'
 
-if which update-noosfero-odbc > /dev/null ; then
+if which update-noosfero-odbc &> /dev/null ; then
   update-noosfero-odbc
 fi
 



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/bfb6dcbf9685ef481f2fbd0a8a4a2507f294dbfa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160502/571f4785/attachment-0001.html>


More information about the Noosfero-dev mailing list