[DRE-commits] [redmine] 01/15: Change Gemfile.lock handling; avoid problems with installed plugins

Antonio Terceiro terceiro at moszumanska.debian.org
Sat May 2 21:00:04 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 dd2aa37444c441b8ebdea293a107e8dcd2cdd591
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Wed Apr 8 16:30:39 2015 +0200

    Change Gemfile.lock handling; avoid problems with installed plugins
---
 debian/changelog        |  5 +++++
 debian/links            |  2 +-
 debian/postinst         | 20 ++++++++++++++++++++
 debian/postrm           |  1 +
 debian/redmine.triggers |  1 +
 5 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 6639077..fa175b1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,11 @@ 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
+  * Change Gemfile.lock handling to avoid all types of problems with installed
+    plugins
+    - symlink Gemfile.lock to /var/lib/redmine/Gemfile.lock
+    - always update it at the beginning of debian/postinst
+    - trigger postinst on all Ruby packade updates
   * 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
diff --git a/debian/links b/debian/links
index 7268fbc..f296756 100644
--- a/debian/links
+++ b/debian/links
@@ -5,4 +5,4 @@ usr/share/javascript/scriptaculous/controls.js usr/share/redmine/public/javascri
 usr/share/javascript/scriptaculous/dragdrop.js usr/share/redmine/public/javascripts/dragdrop.js
 usr/share/javascript/scriptaculous/effects.js usr/share/redmine/public/javascripts/effects.js
 
-/dev/null                                     usr/share/redmine/Gemfile.lock
+/var/lib/redmine/Gemfile.lock                 usr/share/redmine/Gemfile.lock
diff --git a/debian/postinst b/debian/postinst
index 5aaa2c0..5f97f78 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -10,6 +10,9 @@ RAKE_VERBOSE=false
 
 . /usr/share/debconf/confmodule
 
+# update Gemfile.lock, always
+(cd /usr/share/redmine && bundle --local --quiet)
+
 # remove and purge old instances each time postinst is called
 db_get redmine/old-instances || true
 gOldInstances="${RET}"
@@ -214,6 +217,23 @@ for lInstance in $gInstances; do
 	fi
 	case "$1" in
 		configure|reconfigure|triggered)
+
+			skip_db_upgrade_actions=false
+			if [ "$1" = triggered ]; then
+				# Skip the heavy operations below unless triggered by a plugin, in
+				# which case we do need to do all that.
+				skip_db_upgrade_actions=true
+				case " $2 " in
+					*' /usr/share/redmine/plugins '*)
+						echo "I: redmine plugins installed/upgraded, DB upgrade needed"
+						skip_db_upgrade_actions=false
+						;;
+				esac
+			fi
+			if [ "$skip_db_upgrade_actions" = true ]; then
+				exit 0
+			fi
+
 			if dpkg --compare-versions "$2" lt "2.3.0+dfsg1-3~"; then
 			    rm -rf $fRailsCache
 			fi
diff --git a/debian/postrm b/debian/postrm
index 79c2cf0..58411a2 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -81,6 +81,7 @@ case "$1" in
 		rm -rf /var/lib/redmine/*/sessions
 		rm -rf /var/cache/redmine
 		rm -rf /etc/redmine
+		rm -f /var/lib/redmine/Gemfile.lock
 		# user files are not
 		rmdir /var/lib/redmine/*/files || true
 		rmdir /var/lib/redmine/* || true
diff --git a/debian/redmine.triggers b/debian/redmine.triggers
index 2167263..1df65ca 100644
--- a/debian/redmine.triggers
+++ b/debian/redmine.triggers
@@ -1 +1,2 @@
 interest /usr/share/redmine/plugins
+interest /usr/lib/ruby/vendor_ruby

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