[DRE-commits] [diaspora-installer] 03/06: use ${diaspora_conf} if present

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Sun Aug 28 17:23:58 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 31a796ad5449b73dd283fd107680ec38b87402a5
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Sun Aug 28 22:24:58 2016 +0530

    use ${diaspora_conf} if present
---
 set-env-diaspora.sh | 38 +++++++++++++++++++++++++-------------
 1 file changed, 25 insertions(+), 13 deletions(-)

diff --git a/set-env-diaspora.sh b/set-env-diaspora.sh
index 9fb566b..666229a 100755
--- a/set-env-diaspora.sh
+++ b/set-env-diaspora.sh
@@ -2,19 +2,31 @@
 
 # Read configuration from file
 . /etc/diaspora/diaspora-common.conf
-echo "Using ${diaspora_conf_private}..."
-if ! grep RAILS_ENV ${diaspora_conf_private}
-	then echo export RAILS_ENV=production >> ${diaspora_conf_private}
-fi
+if test -f ${diaspora_conf}; then
+  echo "Using ${diaspora_conf}..."
+  echo "Older versions did not set BUNDLE_WITH variable"
+  echo "Setting BUNDLE_WITH variable in ${diaspora_conf}..."
+  if ! grep BUNDLE_WITH ${diaspora_conf}; then
+    if [ $(grep DB ${diaspora_conf} |cut -d= -f2) = "postgres" ]; then
+      echo export BUNDLE_WITH=postgresql >> ${diaspora_conf}
+    else
+      echo export BUNDLE_WITH=mysql >> ${diaspora_conf}
+    fi
+  fi
+else
+  echo "Using ${diaspora_conf_private}..."
+  if ! grep RAILS_ENV ${diaspora_conf_private}; then
+    echo export RAILS_ENV=production >> ${diaspora_conf_private}
+  fi
 
-if ! grep DB ${diaspora_conf_private} 
-	then echo export DB=postgres >> ${diaspora_conf_private}
-fi
+  if ! grep DB ${diaspora_conf_private}; then
+    echo export DB=postgres >> ${diaspora_conf_private}
+  fi
 	
-if ! grep BUNDLE_WITH ${diaspora_conf_private} 
-	then echo export BUNDLE_WITH=postgresql >> ${diaspora_conf_private}
-fi
+  if ! grep BUNDLE_WITH ${diaspora_conf_private}; then
+    echo export BUNDLE_WITH=postgresql >> ${diaspora_conf_private}
+  fi
 	
-# source diaspora variables	
-. ${diaspora_conf_private}
-
+  # source diaspora variables	
+  . ${diaspora_conf_private}
+fi

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