[Git][noosfero/noosfero][stable-1.5] 2 commits: Merge branch 'noosfero-chat-db-dependency' into 'master'

Rodrigo Souto gitlab at mg.gitlab.com
Mon May 2 19:53:32 BRT 2016


Rodrigo Souto pushed to branch stable-1.5 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
- - - - -
785fe584 by Rodrigo Souto at 2016-05-02T22:53:26+00:00
Merge branch 'cherry-pick-62193d8b' into 'stable-1.5'

Merge branch 'noosfero-chat-db-dependency' into 'stable-1.5'

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



See merge request !830

See merge request !886
- - - - -


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/compare/bf9720c95b93d07879d92d2b6492abb626765f89...785fe5840732e9acfe58adeadf6b6b3805881a0b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160502/615db7bb/attachment-0001.html>


More information about the Noosfero-dev mailing list