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

Ondřej Surý ondrej at sury.org
Thu Mar 21 14:37:26 UTC 2013


The following commit has been merged in the master-experimental branch:
commit 58118eccb6cba1b4aee5d3f1637b041f4b08d296
Author: Ondřej Surý <ondrej at sury.org>
Date:   Thu Mar 21 14:16:29 2013 +0100

    Move cache directory under cache/ subdirectory, so the rake task works.

diff --git a/debian/patches/2002_FHS_through_env_vars.patch b/debian/patches/2002_FHS_through_env_vars.patch
index 1ebfa80..f4f363d 100644
--- a/debian/patches/2002_FHS_through_env_vars.patch
+++ b/debian/patches/2002_FHS_through_env_vars.patch
@@ -63,26 +63,28 @@ Last-Update: 2012-01-19
 +ENV['RAILS_ETC'] ||= "/etc/redmine/#{ENV['X_DEBIAN_SITEID']}"
 +ENV['RAILS_LOG'] ||= "/var/log/redmine/#{ENV['X_DEBIAN_SITEID']}"
 +ENV['RAILS_VAR'] ||= "/var/lib/redmine/#{ENV['X_DEBIAN_SITEID']}"
-+ENV['RAILS_CACHE'] ||= "/var/cache/redmine/#{ENV['X_DEBIAN_SITEID']}"
++ENV['RAILS_TMP'] ||= "/var/cache/redmine/#{ENV['X_DEBIAN_SITEID']}"
 +
  if defined?(Bundler)
    # If you precompile assets before deploying to production, use this line
    Bundler.require(*Rails.groups(:assets => %w(development test)))
-@@ -55,6 +66,17 @@ module RedmineApp
+@@ -53,8 +64,19 @@ module RedmineApp
+     # Do not include all helpers
+     config.action_controller.include_all_helpers = false
  
++    # move tmp directory to RAILS_TMP
++    config.paths['tmp'] = ENV['RAILS_TMP']
++
      config.session_store :cookie_store, :key => '_redmine_session'
  
 +    # log path
 +    config.paths['log'] = File.join(ENV['RAILS_LOG'], "#{Rails.env}.log") unless !ENV['RAILS_LOG']
 +
-+    config.cache_store = :file_store, ENV['RAILS_CACHE']
++    config.cache_store = :file_store, File.join(ENV['RAILS_TMP'], "cache")
 +
 +    # Set Active Record's database.yml path
 +    config.paths['config/database'] = File.join(ENV['RAILS_ETC'], 'database.yml') unless !ENV['RAILS_ETC']
 +
-+    # move tmp directory to RAILS_CACHE
-+    config.paths['tmp'] = File.join(ENV['RAILS_CACHE'], "tmp")
-+
      if File.exists?(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
        instance_eval File.read(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
      end
diff --git a/debian/patches/2003_externalize_session_config.patch b/debian/patches/2003_externalize_session_config.patch
index 518de7c..10c148d 100644
--- a/debian/patches/2003_externalize_session_config.patch
+++ b/debian/patches/2003_externalize_session_config.patch
@@ -50,9 +50,9 @@ Last-Update: 2010-01-10
 -task :generate_secret_token => ['config/initializers/secret_token.rb']
 --- a/config/application.rb
 +++ b/config/application.rb
-@@ -64,7 +64,20 @@ module RedmineApp
-     # Do not include all helpers
-     config.action_controller.include_all_helpers = false
+@@ -67,7 +67,20 @@ module RedmineApp
+     # move tmp directory to RAILS_TMP
+     config.paths['tmp'] = ENV['RAILS_TMP']
  
 -    config.session_store :cookie_store, :key => '_redmine_session'
 +    # loads cookie based session session and secret keys
diff --git a/debian/postinst b/debian/postinst
index 9d3e33a..0bf4edf 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -278,15 +278,16 @@ This may take a while."
 			else
 				echo "Redmine instance \"${lInstance}\" database must be configured manually."
 			fi
-			rake -s tmp:cache:clear RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || fCode=$?
-			if [ $fCode -ne 0 ];
-				echo "Error when clearing cache. You might need to clear the cache manually."
+			echo "Clearing the cache directory for redmine instance \"${lInstance}\".
+This may take a while."
+			if dpkg --compare-versions "$2" lt "2.3.0+dfsg1-3~"; then
+			    rm -rf /var/cache/redmine/${lInstance}/
+			    mkdir /var/cache/redmine/${lInstance}/cache
 			fi
-			rake -s tmp:sessions:clear RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || fCode=$?
+			rake -s tmp:cache:clear RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || fCode=$?
 			if [ $fCode -ne 0 ];
-				echo "Error when clearing sessions. You might need to clear the session directory manually."
-			fi
-			
+				echo "Error when clearing cache. You might need to clear the cache directory /var/cache/redmine/${lInstance}/ manually."
+			fi			
 			cd $savedir || true
 		;;
 	

-- 
redmine.git



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