[DRE-commits] [diaspora] 06/08: bundle install can run only after diaspora.conf is created

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Mon Jan 23 13:55:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository diaspora.

commit 06b0db767f33b023f67b205f2fd45c8defc36b5f
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Mon Jan 23 18:41:46 2017 +0530

    bundle install can run only after diaspora.conf is created
---
 debian/postinst | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/debian/postinst b/debian/postinst
index 03f500f..6539790 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -34,27 +34,29 @@ chown -R ${diaspora_user}: ${diaspora_home}
 cd ${diaspora_home}
 	
 #######################################################################
-# update Gemfile.lock, always
+# update Gemfile.lock, after first install
 #######################################################################
-su ${diaspora_user} -s /bin/sh -c 'truncate -s 0 ${diaspora_home}/Gemfile.lock'
-if ! su ${diaspora_user} -s /bin/sh -c 'bundle --local --quiet'; then
-  if [ "$1" = "triggered" ]; then
-    # probably triggered in the middle of an system upgrade; ignore failure
-    # but abort here
-    echo "#########################################################################"
-    echo "# Failed to detect gitlab dependencies; if you are in the middle of an #"
-    echo "# upgrade, this is probably fine, there will be another attempt later.  #"
-    echo "#                                                                       #"
-    echo "# If you are NOT in the middle of an upgrade, there is probably a real  #"
-    echo "# issue. Please report a bug.                                           #"
-    echo "#########################################################################"
-    exit 0
-  else
-    # something is really broken
-    exit 1
+if -e ${diaspora_conf}; then
+  . ${diaspora_conf}
+  su ${diaspora_user} -s /bin/sh -c 'truncate -s 0 ${diaspora_home}/Gemfile.lock'
+  if ! su ${diaspora_user} -s /bin/sh -c 'bundle --local --quiet'; then
+    if [ "$1" = "triggered" ]; then
+      # probably triggered in the middle of an system upgrade; ignore failure
+      # but abort here
+      echo "#########################################################################"
+      echo "# Failed to detect gitlab dependencies; if you are in the middle of an #"
+      echo "# upgrade, this is probably fine, there will be another attempt later.  #"
+      echo "#                                                                       #"
+      echo "# If you are NOT in the middle of an upgrade, there is probably a real  #"
+      echo "# issue. Please report a bug.                                           #"
+      echo "#########################################################################"
+      exit 0
+    else
+      # something is really broken
+      exit 1
+    fi
   fi
 fi
-
 case "$1" in
     configure)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/diaspora.git



More information about the Pkg-ruby-extras-commits mailing list