[DRE-commits] [redmine] 03/15: debian/postinst: only use $2 as version on upgrades

Antonio Terceiro terceiro at moszumanska.debian.org
Sat May 2 21:00:05 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 11587dc6825f692d3f5a6bee2537b36f852317c3
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Wed Apr 8 17:31:36 2015 +0200

    debian/postinst: only use $2 as version on upgrades
---
 debian/changelog | 2 ++
 debian/postinst  | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 712c637..d9da92f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,8 @@ redmine (3.0~20140825-6) UNRELEASED; urgency=medium
       - pass SCHEMA=/dev/null to rake `db:migrate` so it won't create
         /usr/share/redmine/db/schema.rb
     - debian/postrm: remove the aforementioned files
+  * debian/postinst: restrict usage of $2 as a version number to actual
+    upgrades.
 
  -- Antonio Terceiro <terceiro at debian.org>  Wed, 08 Apr 2015 12:06:32 +0200
 
diff --git a/debian/postinst b/debian/postinst
index c3c535d..aa843c0 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -228,7 +228,7 @@ for lInstance in $gInstances; do
 				exit 0
 			fi
 
-			if dpkg --compare-versions "$2" lt "2.3.0+dfsg1-3~"; then
+			if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt "2.3.0+dfsg1-3~"; then
 			    rm -rf $fRailsCache
 			fi
 			# create directories
@@ -263,7 +263,7 @@ for lInstance in $gInstances; do
 			#fi
 			# 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
+			if [ ! -f "${fRailsEtc}/session.yml" ] || [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt "2.1.4+dfsg2-2~"; then
 				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

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