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

Jérémy Lal kapouer-guest at alioth.debian.org
Mon Feb 8 12:57:03 UTC 2010


Author: kapouer-guest
Date: 2010-02-08 12:57:02 +0000 (Mon, 08 Feb 2010)
New Revision: 4611

Modified:
   trunk/redmine/debian/postinst
Log:
Migrate db and plugins even if databases are not set as reinstalled in dbconfig

Modified: trunk/redmine/debian/postinst
===================================================================
--- trunk/redmine/debian/postinst	2010-02-08 12:57:00 UTC (rev 4610)
+++ trunk/redmine/debian/postinst	2010-02-08 12:57:02 UTC (rev 4611)
@@ -29,6 +29,7 @@
 	if which ucf >/dev/null 2>&1; then
 		ucf --purge /etc/redmine/$lInstance/database.yml
 		ucf --purge /etc/redmine/$lInstance/email.yml
+		ucf --purge /etc/redmine/$lInstance/session.yml
 	fi
 	rm -rf /etc/redmine/$lInstance
 done
@@ -175,6 +176,10 @@
 			ucf --debconf-ok $fYml /etc/redmine/$lInstance/database.yml
 			rm -f $fYml
 		fi
+	elif [ -e "$fRailsEtc/database.yml" ]; then
+		# don't reinstall, but upgrade
+		withdb=1
+		lInstall=0
 	fi
 	case "$1" in
 		configure|reconfigure)
@@ -218,14 +223,14 @@
 This may take a while."
 				rake -s db:migrate RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || true
 				echo "Done."
-				rake -s redmine:load_default_data RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" REDMINE_LANG=$DEFAULT_LANGUAGE || true
-				# because rake task is executed as root here, and this file is used later by web server, make sure owner is www-data
-				touch ${fRailsLog}/production.log
-				chown -f www-data:www-data ${fRailsLog}/production.log
+				if [ $lInstall -eq 1 ]; then
+					rake -s redmine:load_default_data RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" REDMINE_LANG=$DEFAULT_LANGUAGE || true
+					# because rake task is executed as root here, and this file is used later by web server, make sure owner is www-data
+					touch ${fRailsLog}/production.log
+					chown -f www-data:www-data ${fRailsLog}/production.log
+				fi
 				# handle plugins migration
 				rake -s db:migrate_plugins RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || true
-			elif [ $lInstall -eq 0 ]; then
-				echo "Redmine instance \"${lInstance}\" database is not reinstalled."
 			else
 				echo "Redmine instance \"${lInstance}\" database must be configured manually."
 			fi




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