[DRE-commits] [SCM] redmine.git branch, master-experimental, updated. debian/1.4.4+dfsg1-1-64-g291dbc7

Ondřej Surý ondrej at sury.org
Sun Dec 16 20:37:10 UTC 2012


The following commit has been merged in the master-experimental branch:
commit 291dbc7f209dc0969744992b28431b796aa93088
Author: Ondřej Surý <ondrej at sury.org>
Date:   Wed Dec 12 16:20:09 2012 +0100

    Rework the logic of replacing session tokens to trigger when the file doesn't exist or we are upgrading from previous version

diff --git a/debian/postinst b/debian/postinst
index aebba24..84164e4 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -231,12 +231,9 @@ for lInstance in $gInstances; do
 				mv "$fRailsEtc/email.yml" "$fRailsEtc/configuration.yml"
 			fi
 			#fi
-			if dpkg --compare-versions "$2" lt "2.1.4+dfsg2-2~" && [ -f "${fRailsEtc}/session.yml" ]; then
-			    ucf --purge "${fRailsEtc}/session.yml"
-			    mv "${fRailsEtc}/session.yml" "${fRailsEtc}/session.yml.dpkg-old";
-			fi
 			# add secret key, set permissions, manage file with ucf
-			if [ ! -f "${fRailsEtc}/session.yml" ]; then
+			# 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
 				chown -f root:www-data ${fRailsEtc}/session.yml.new
 				chmod 640 ${fRailsEtc}/session.yml.new

-- 
redmine.git



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