[DRE-commits] [redmine] 01/02: debian/postinst: run rake under `bundle install`

Antonio Terceiro terceiro at moszumanska.debian.org
Wed Apr 8 13:50:22 UTC 2015


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

terceiro pushed a commit to branch master
in repository redmine.

commit 31bf581fa314643fea5ba577485bf4895648ab7c
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Wed Apr 8 12:17:58 2015 +0200

    debian/postinst: run rake under `bundle install`
---
 debian/changelog |  5 ++++-
 debian/postinst  | 10 +++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 54794c9..699e972 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,10 @@
 redmine (3.0~20140825-6) UNRELEASED; urgency=medium
 
   * debian/doc/examples/apache2-host.conf: fix typo in package name user is
-    told to install (Closes: #777736)
+    told to install Closes: #777736
+  * debian/postinst: run rake under `bundle exec` to correctly handle
+    upgrades when the local admin installed non-packaged plugins (i.e. ~100%
+    of them). Closes: #779273
 
  -- Antonio Terceiro <terceiro at debian.org>  Wed, 08 Apr 2015 12:06:32 +0200
 
diff --git a/debian/postinst b/debian/postinst
index 8615657..0630c7d 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -250,7 +250,7 @@ for lInstance in $gInstances; do
 			# add secret key, set permissions, manage file with ucf
 			# trigger when session file doesn't exist or we are upgrading from previous version
 			if [ ! -f "${fRailsEtc}/session.yml" ] || dpkg --compare-versions "$2" lt "2.1.4+dfsg2-2~"; then
-				rake -s generate_secret_token YML_SESSION_FILENAME="session.yml.new" RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" || true
+				bundle exec rake -s generate_secret_token YML_SESSION_FILENAME="session.yml.new" RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" || true
 				chown -f root:www-data ${fRailsEtc}/session.yml.new
 				chmod 640 ${fRailsEtc}/session.yml.new
 				ucf --debconf-ok ${fRailsEtc}/session.yml.new ${fRailsEtc}/session.yml
@@ -276,17 +276,17 @@ for lInstance in $gInstances; do
 				echo "Populating database for redmine instance \"${lInstance}\".
 This may take a while."
 				fCode=0
-				rake -s db:migrate RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || fCode=$?
+				bundle exec 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
+						bundle exec 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 redmine:plugins:migrate RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || true
+					bundle exec rake -s redmine:plugins:migrate RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || true
 				else
 					echo "Error when running rake db:migrate, check database configuration."
 					exit 1
@@ -296,7 +296,7 @@ This may take a while."
 			fi
 			echo "Clearing the cache directory for redmine instance \"${lInstance}\".
 This may take a while."
-			rake -s tmp:cache:clear RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || fCode=$?
+			bundle exec rake -s tmp:cache:clear RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || fCode=$?
 			if [ $fCode -ne 0 ]; then
 				echo "Error when clearing cache. You might need to clear the cache directory /var/cache/redmine/${lInstance}/ manually."
 			fi			

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/redmine.git



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