[DRE-commits] r5721 - trunk/redmine/debian

Jérémy Lal kapouer-guest at alioth.debian.org
Fri Jul 30 13:16:02 UTC 2010


Author: kapouer-guest
Date: 2010-07-30 13:15:44 +0000 (Fri, 30 Jul 2010)
New Revision: 5721

Modified:
   trunk/redmine/debian/postinst
Log:
Display a note in postinst if a db type is chosen and the corresponding redmine-<dbtype> package is not installed. Abort install of that instance in that case.

The note cannot be displayed in debian/config because at that moment,
redmine-<mysql|sqlite|pgsql> may not be marked as installed.

Modified: trunk/redmine/debian/postinst
===================================================================
--- trunk/redmine/debian/postinst	2010-07-30 13:15:34 UTC (rev 5720)
+++ trunk/redmine/debian/postinst	2010-07-30 13:15:44 UTC (rev 5721)
@@ -124,9 +124,25 @@
 		# if dbtype=sqlite3, use dbbasepath, else dbname
 		fCode=0
 		db_get redmine/instances/$lInstance/database-type || fCode=$?
-		if [ $fCode -eq 0 -a "$RET" = "sqlite3" ]; then
+		lDbType="$RET"
+		if [ $fCode -eq 0 -a "$lDbType" = "sqlite3" ]; then
 			lTemplate="database-sqlite.yml.template"
+			lDbType="sqlite"
 		fi
+		# check if redmine-$lDbType is installed, if not, don't configure and explain what to do
+		hasPack=$(dpkg-query -W -f='${Status}\n' "redmine-$lDbType" |cut -d" " -f3)
+		if [ "$hasPack" != "installed" ]; then
+			# not installed, this cannot be detected in debian/config
+			# since redmine-* packages are not yet installed
+			db_subst redmine/missing-redmine-package dbtype "$lDbType"
+			db_subst redmine/missing-redmine-package instance "$lInstance"
+			db_fset redmine/missing-redmine-package seen "false"
+			db_input high redmine/missing-redmine-package || true
+			db_go || true
+			db_stop || true
+			echo "Skipping $lInstance because of missing dependency."
+			continue
+		fi
 		
 		dbc_generate_include=template:$fYml
 		dbc_generate_include_args="-o template_infile=/usr/share/redmine/templates/${lTemplate}"




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