[DRE-commits] [diaspora-installer] 08/21: check if its a stale database

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Mon May 11 12:36:48 UTC 2015


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

praveen pushed a commit to branch master
in repository diaspora-installer.

commit 48c89cd47273f7c8fc10042358237dc93479669c
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Mon May 11 13:23:01 2015 +0530

    check if its a stale database
---
 debian/diaspora-common.postinst | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/debian/diaspora-common.postinst b/debian/diaspora-common.postinst
index 36cfa53..263a63f 100755
--- a/debian/diaspora-common.postinst
+++ b/debian/diaspora-common.postinst
@@ -33,13 +33,19 @@ case "$1" in
         # Check if there is another version installed
         if su diaspora -s /bin/sh -c "psql  diaspora_production -c ''"
         then
-            # Show current version of package
-	    installed_diaspora_version=`echo $2|cut -d+ -f1`
-            installed_diaspora_minor_version=`echo ${installed_diaspora_version} |cut -d. -f3,4`
-            diaspora_minor_version=`echo ${diaspora_version} |cut -d. -f3,4`
-            if test $(echo "${installed_diaspora_minor_version} < ${diaspora_minor_version}" |bc) -eq 1
+            if ! test -z $2
             then
-	        echo "Trying update from ${installed_diaspora_version}..."
+                # Show current version of package
+    	        installed_diaspora_version=`echo $2|cut -d+ -f1`
+                installed_diaspora_minor_version=`echo ${installed_diaspora_version} |cut -d. -f3,4`
+                diaspora_minor_version=`echo ${diaspora_version} |cut -d. -f3,4`
+                if test $(echo "${installed_diaspora_minor_version} < ${diaspora_minor_version}" |bc) -eq 1
+                then
+	            echo "Trying update from ${installed_diaspora_version}..."
+                fi
+            else
+                echo "There is a PostgreSQl database 'diaspora_production', aborting installation..."
+                echo "You may drop the database and try reinstalling"
             fi
 
         else

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