[DRE-commits] [diaspora-installer] 01/21: add a preinst hook to abort upgrade from < 0.5

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Mon May 11 12:36:47 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 53d3741eb15e89a125b820ff93decc2f2ab1ffa0
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Mon May 11 09:43:24 2015 +0530

    add a preinst hook to abort upgrade from < 0.5
---
 debian/diaspora-common.preinst | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/debian/diaspora-common.preinst b/debian/diaspora-common.preinst
new file mode 100755
index 0000000..4c4e944
--- /dev/null
+++ b/debian/diaspora-common.preinst
@@ -0,0 +1,26 @@
+#! /bin/sh
+set -e
+
+case "$1" in
+    upgrade)
+        if su diaspora -s /bin/sh -c "psql  diaspora_production -c ''"
+        then
+            echo "You already have a PostgreSQL database named 'diaspora_production'."
+            # Show current version of package
+            installed_diaspora_version=`echo $2|cut -d+ -f1`
+            echo "Trying update from ${installed_diaspora_version}..."
+            installed_diaspora_major_version=`echo ${installed_diaspora_version} |cut -d. -f1,2`
+            if test $(echo "${installed_diaspora_major_version} < 0.5" |bc) -eq 1
+            then
+                echo "Updating from 0.4.x is not supported yet."
+	        exit 1
+            fi
+        fi
+        ;;
+    abort-upgrade|install)
+        ;;
+    *)
+        echo "preinst called with unknown argument \`$1'" >&2
+        exit 1
+        ;;
+esac

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