[DRE-commits] [SCM] redmine.git branch, master-experimental, updated. debian/1.1.3-1-20-g8467338

Jérémy Lal kapouer at melix.org
Tue Jul 5 20:10:42 UTC 2011


The following commit has been merged in the master-experimental branch:
commit 889576a6bd6732701954508b1c7a2e24af68a690
Author: Jérémy Lal <kapouer at melix.org>
Date:   Tue Jul 5 22:08:18 2011 +0200

    Output a message and exit with an error if rake db:migrate fails.

diff --git a/debian/postinst b/debian/postinst
index a077d87..2eb0e3b 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -250,16 +250,22 @@ for lInstance in $gInstances; do
 				# handle rake install
 				echo "Populating database for redmine instance \"${lInstance}\".
 This may take a while."
-				rake -s db:migrate RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || true
-				echo "Done."
-				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
+				fCode=0
+				rake -s db:migrate RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || fCode=$?
+				if [ $fCode -eq 0 ]; then
+					echo "Done."
+					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
+				else
+					echo "Error when running rake db:migrate, check database configuration."
+					exit -1
 				fi
-				# handle plugins migration
-				rake -s db:migrate_plugins RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || true
 			else
 				echo "Redmine instance \"${lInstance}\" database must be configured manually."
 			fi

-- 
redmine.git



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