[DRE-commits] r4615 - in trunk/redmine/debian: . patches

Jérémy Lal kapouer-guest at alioth.debian.org
Wed Feb 10 00:44:53 UTC 2010


Author: kapouer-guest
Date: 2010-02-10 00:44:52 +0000 (Wed, 10 Feb 2010)
New Revision: 4615

Added:
   trunk/redmine/debian/patches/0004-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch
   trunk/redmine/debian/patches/0005-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch
   trunk/redmine/debian/patches/0006-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch
   trunk/redmine/debian/patches/0007-Revert-this-rails-2.3-plugin.patch
   trunk/redmine/debian/patches/0008-Wrong-path-for-interpreter.patch
   trunk/redmine/debian/patches/0009-Allows-environment-variables-to-setup-debian-paths.patch
   trunk/redmine/debian/patches/0010-Move-session-configuration-to-YML-file-next-to-datab.patch
   trunk/redmine/debian/patches/0011-Duplicate-name-value-in-request.patch
   trunk/redmine/debian/patches/0012-REST-API-for-my-account.patch
   trunk/redmine/debian/patches/0013-Sanitize-textarea-id-for-rails2.2.patch
   trunk/redmine/debian/patches/0014-OrderedHash-to-Hash.patch
   trunk/redmine/debian/patches/0015-Monkey-patches-for-group-support-taken-from-rails-2..patch
Removed:
   trunk/redmine/debian/patches/0004-Monkey-patches-for-group-support-taken-from-rails-2..patch
   trunk/redmine/debian/patches/0005-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch
   trunk/redmine/debian/patches/0006-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch
   trunk/redmine/debian/patches/0007-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch
   trunk/redmine/debian/patches/0008-Revert-this-rails-2.3-plugin.patch
   trunk/redmine/debian/patches/0009-Wrong-path-for-interpreter.patch
   trunk/redmine/debian/patches/0010-Allows-environment-variables-to-setup-debian-paths.patch
   trunk/redmine/debian/patches/0011-Move-session-configuration-to-YML-file-next-to-datab.patch
   trunk/redmine/debian/patches/0012-Duplicate-name-value-in-request.patch
   trunk/redmine/debian/patches/0013-REST-API-for-my-account.patch
   trunk/redmine/debian/patches/0014-Sanitize-textarea-id-for-rails2.2.patch
   trunk/redmine/debian/patches/0015-OrderedHash-to-Hash.patch
Modified:
   trunk/redmine/debian/changelog
   trunk/redmine/debian/patches/series
Log:
The select form helper patch was incomplete, fix it using rails 2.3 code.

Modified: trunk/redmine/debian/changelog
===================================================================
--- trunk/redmine/debian/changelog	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/changelog	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,3 +1,10 @@
+redmine (0.9.2-2) unstable; urgency=low
+
+  * Fix forms select helper, another rails 2.2 incompatibility.
+    (Closes: #569080) 
+
+ -- Jérémy Lal <kapouer at melix.org>  Wed, 10 Feb 2010 01:42:02 +0100
+
 redmine (0.9.2-1) unstable; urgency=low
 
   * Upstream update

Deleted: trunk/redmine/debian/patches/0004-Monkey-patches-for-group-support-taken-from-rails-2..patch
===================================================================
--- trunk/redmine/debian/patches/0004-Monkey-patches-for-group-support-taken-from-rails-2..patch	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/0004-Monkey-patches-for-group-support-taken-from-rails-2..patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,63 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sat, 9 Jan 2010 23:30:15 +0100
-Subject: [PATCH] Monkey patches for group support, taken from rails 2.3.
-
----
- config/initializers/action_group.rb |   47 +++++++++++++++++++++++++++++++++++
- 1 files changed, 47 insertions(+), 0 deletions(-)
- create mode 100644 config/initializers/action_group.rb
-
-diff --git a/config/initializers/action_group.rb b/config/initializers/action_group.rb
-new file mode 100644
-index 0000000..95a9e78
---- /dev/null
-+++ b/config/initializers/action_group.rb
-@@ -0,0 +1,47 @@
-+module ActionView
-+  module Helpers
-+    module FormOptionsHelper
-+      def grouped_options_for_select(grouped_options, selected_key = nil, prompt = nil)
-+        body = ''
-+        body << content_tag(:option, prompt, :value => "") if prompt
-+        grouped_options = grouped_options.sort if grouped_options.is_a?(Hash)
-+        grouped_options.each do |group|
-+          body << content_tag(:optgroup, options_for_select(group[1], selected_key), :label => group[0])
-+        end
-+        body
-+      end
-+    end
-+  end
-+
-+  require 'action_view/test_case'
-+  require 'action_controller/test_process'
-+  class FormOptionsHelperTest < ActionView::TestCase
-+    def test_grouped_options_for_select_with_array
-+      assert_dom_equal(
-+            "<optgroup label=\"North America\"><option value=\"US\">United States</option>\n<option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\"><option value=\"GB\">Great Britain</option>\n<option value=\"Germany\">Germany</option></optgroup>",
-+            grouped_options_for_select([
-+               ["North America",
-+                       [['United States','US'],"Canada"]],
-+               ["Europe",
-+                       [["Great Britain","GB"], "Germany"]]
-+             ])
-+      )
-+    end
-+
-+    def test_grouped_options_for_select_with_selected_and_prompt
-+      assert_dom_equal(
-+              "<option value=\"\">Choose a product...</option><optgroup label=\"Hats\"><option value=\"Baseball Cap\">Baseball Cap</option>\n<option selected=\"selected\" value=\"Cowboy Hat\">Cowboy Hat</option></optgroup>",
-+              grouped_options_for_select([["Hats", ["Baseball Cap","Cowboy Hat"]]], "Cowboy Hat", "Choose a product...")
-+      )
-+    end
-+
-+    def test_optgroups_with_with_options_with_hash
-+      assert_dom_equal(
-+             "<optgroup label=\"Europe\"><option value=\"Denmark\">Denmark</option>\n<option value=\"Germany\">Germany</option></optgroup><optgroup label=\"North America\"><option value=\"United States\">United States</option>\n<option value=\"Canada\">Canada</option></optgroup>",
-+             grouped_options_for_select({'North America' => ['United States','Canada'], 'Europe' => ['Denmark','Germany']})
-+      )
-+    end
-+  end
-+end
-+
-+
--- 

Copied: trunk/redmine/debian/patches/0004-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch (from rev 4614, trunk/redmine/debian/patches/0005-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch)
===================================================================
--- trunk/redmine/debian/patches/0004-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0004-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -0,0 +1,23 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sat, 12 Dec 2009 18:19:39 +0100
+Subject: [PATCH] Returns a hash in any case, since rails 2.2 could return an OrderedHash, which is an array.
+
+---
+ app/models/query.rb |    3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/app/models/query.rb b/app/models/query.rb
+index 788f34e..bb87284 100644
+--- a/app/models/query.rb
++++ b/app/models/query.rb
+@@ -430,6 +430,9 @@ class Query < ActiveRecord::Base
+         r = r.keys.inject({}) {|h, k| h[c.custom_field.cast_value(k)] = r[k]; h}
+       end
+     end
++    if !r.nil? && r.is_a?(ActiveSupport::OrderedHash)
++      r = r.to_hash
++    end
+     r
+   rescue ::ActiveRecord::StatementInvalid => e
+     raise StatementInvalid.new(e.message)
+-- 

Copied: trunk/redmine/debian/patches/0005-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch (from rev 4614, trunk/redmine/debian/patches/0006-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch)
===================================================================
--- trunk/redmine/debian/patches/0005-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0005-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -0,0 +1,19 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sun, 13 Dec 2009 12:56:46 +0100
+Subject: [PATCH] No need to declare dependency on mocha. It's there but rails2.2 thinks it's not.
+
+---
+ config/environments/test.rb |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/config/environments/test.rb b/config/environments/test.rb
+index 0d1b42e..fd764b8 100644
+--- a/config/environments/test.rb
++++ b/config/environments/test.rb
+@@ -26,4 +26,4 @@ config.action_controller.allow_forgery_protection  = false
+ 
+ config.gem "thoughtbot-shoulda", :lib => "shoulda", :source => "http://gems.github.com"
+ config.gem "nofxx-object_daddy", :lib => "object_daddy", :source => "http://gems.github.com"
+-config.gem "mocha"
++#config.gem "mocha"
+-- 

Deleted: trunk/redmine/debian/patches/0005-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch
===================================================================
--- trunk/redmine/debian/patches/0005-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/0005-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,23 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sat, 12 Dec 2009 18:19:39 +0100
-Subject: [PATCH] Returns a hash in any case, since rails 2.2 could return an OrderedHash, which is an array.
-
----
- app/models/query.rb |    3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
-
-diff --git a/app/models/query.rb b/app/models/query.rb
-index 788f34e..bb87284 100644
---- a/app/models/query.rb
-+++ b/app/models/query.rb
-@@ -430,6 +430,9 @@ class Query < ActiveRecord::Base
-         r = r.keys.inject({}) {|h, k| h[c.custom_field.cast_value(k)] = r[k]; h}
-       end
-     end
-+    if !r.nil? && r.is_a?(ActiveSupport::OrderedHash)
-+      r = r.to_hash
-+    end
-     r
-   rescue ::ActiveRecord::StatementInvalid => e
-     raise StatementInvalid.new(e.message)
--- 

Deleted: trunk/redmine/debian/patches/0006-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch
===================================================================
--- trunk/redmine/debian/patches/0006-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/0006-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,19 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sun, 13 Dec 2009 12:56:46 +0100
-Subject: [PATCH] No need to declare dependency on mocha. It's there but rails2.2 thinks it's not.
-
----
- config/environments/test.rb |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/config/environments/test.rb b/config/environments/test.rb
-index 0d1b42e..fd764b8 100644
---- a/config/environments/test.rb
-+++ b/config/environments/test.rb
-@@ -26,4 +26,4 @@ config.action_controller.allow_forgery_protection  = false
- 
- config.gem "thoughtbot-shoulda", :lib => "shoulda", :source => "http://gems.github.com"
- config.gem "nofxx-object_daddy", :lib => "object_daddy", :source => "http://gems.github.com"
--config.gem "mocha"
-+#config.gem "mocha"
--- 

Copied: trunk/redmine/debian/patches/0006-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch (from rev 4614, trunk/redmine/debian/patches/0007-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch)
===================================================================
--- trunk/redmine/debian/patches/0006-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0006-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -0,0 +1,25 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sun, 13 Dec 2009 14:25:43 +0100
+Subject: [PATCH] Rescue TamperedWithCookie because rails 2.2 does not.
+
+---
+ app/controllers/application_controller.rb |    5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
+index 20a8e57..b388812 100644
+--- a/app/controllers/application_controller.rb
++++ b/app/controllers/application_controller.rb
+@@ -22,6 +22,11 @@ class ApplicationController < ActionController::Base
+   include Redmine::I18n
+ 
+   layout 'base'
++
++  # In case the cookie store secret changes
++  rescue_from CGI::Session::CookieStore::TamperedWithCookie do |exception|	
++    render :text => 'Your session was invalid and has been reset. Please, reload this page.', :status => 500
++  end
+   
+   # Remove broken cookie after upgrade from 0.8.x (#4292)
+   # See https://rails.lighthouseapp.com/projects/8994/tickets/3360
+-- 

Deleted: trunk/redmine/debian/patches/0007-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch
===================================================================
--- trunk/redmine/debian/patches/0007-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/0007-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,25 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sun, 13 Dec 2009 14:25:43 +0100
-Subject: [PATCH] Rescue TamperedWithCookie because rails 2.2 does not.
-
----
- app/controllers/application_controller.rb |    5 +++++
- 1 files changed, 5 insertions(+), 0 deletions(-)
-
-diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
-index 20a8e57..b388812 100644
---- a/app/controllers/application_controller.rb
-+++ b/app/controllers/application_controller.rb
-@@ -22,6 +22,11 @@ class ApplicationController < ActionController::Base
-   include Redmine::I18n
- 
-   layout 'base'
-+
-+  # In case the cookie store secret changes
-+  rescue_from CGI::Session::CookieStore::TamperedWithCookie do |exception|	
-+    render :text => 'Your session was invalid and has been reset. Please, reload this page.', :status => 500
-+  end
-   
-   # Remove broken cookie after upgrade from 0.8.x (#4292)
-   # See https://rails.lighthouseapp.com/projects/8994/tickets/3360
--- 

Copied: trunk/redmine/debian/patches/0007-Revert-this-rails-2.3-plugin.patch (from rev 4614, trunk/redmine/debian/patches/0008-Revert-this-rails-2.3-plugin.patch)
===================================================================
--- trunk/redmine/debian/patches/0007-Revert-this-rails-2.3-plugin.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0007-Revert-this-rails-2.3-plugin.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -0,0 +1,37 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sun, 22 Nov 2009 23:17:28 +0100
+Subject: [PATCH] Revert this rails 2.3 plugin.
+
+---
+ vendor/plugins/prepend_engine_views/init.rb |   21 ---------------------
+ 1 files changed, 0 insertions(+), 21 deletions(-)
+ delete mode 100644 vendor/plugins/prepend_engine_views/init.rb
+
+diff --git a/vendor/plugins/prepend_engine_views/init.rb b/vendor/plugins/prepend_engine_views/init.rb
+deleted file mode 100644
+index cbf0e89..0000000
+--- a/vendor/plugins/prepend_engine_views/init.rb
++++ /dev/null
+@@ -1,21 +0,0 @@
+-module PrependEngineViews
+-  def self.included(base)
+-    base.send(:include, InstanceMethods)
+-    base.class_eval do
+-      alias_method_chain :add_engine_view_paths, :prepend
+-    end
+-  end
+-
+-  module InstanceMethods
+-    # Patch Rails so engine's views are prepended to the view_path,
+-    # thereby letting plugins override application views
+-    def add_engine_view_paths_with_prepend
+-      paths = ActionView::PathSet.new(engines.collect(&:view_path))
+-      ActionController::Base.view_paths.unshift(*paths)
+-      ActionMailer::Base.view_paths.unshift(*paths) if configuration.frameworks.include?(:action_mailer)
+-    end
+-  end
+-end
+-
+-Rails::Plugin::Loader.send :include, PrependEngineViews
+-
+-- 

Deleted: trunk/redmine/debian/patches/0008-Revert-this-rails-2.3-plugin.patch
===================================================================
--- trunk/redmine/debian/patches/0008-Revert-this-rails-2.3-plugin.patch	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/0008-Revert-this-rails-2.3-plugin.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,37 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sun, 22 Nov 2009 23:17:28 +0100
-Subject: [PATCH] Revert this rails 2.3 plugin.
-
----
- vendor/plugins/prepend_engine_views/init.rb |   21 ---------------------
- 1 files changed, 0 insertions(+), 21 deletions(-)
- delete mode 100644 vendor/plugins/prepend_engine_views/init.rb
-
-diff --git a/vendor/plugins/prepend_engine_views/init.rb b/vendor/plugins/prepend_engine_views/init.rb
-deleted file mode 100644
-index cbf0e89..0000000
---- a/vendor/plugins/prepend_engine_views/init.rb
-+++ /dev/null
-@@ -1,21 +0,0 @@
--module PrependEngineViews
--  def self.included(base)
--    base.send(:include, InstanceMethods)
--    base.class_eval do
--      alias_method_chain :add_engine_view_paths, :prepend
--    end
--  end
--
--  module InstanceMethods
--    # Patch Rails so engine's views are prepended to the view_path,
--    # thereby letting plugins override application views
--    def add_engine_view_paths_with_prepend
--      paths = ActionView::PathSet.new(engines.collect(&:view_path))
--      ActionController::Base.view_paths.unshift(*paths)
--      ActionMailer::Base.view_paths.unshift(*paths) if configuration.frameworks.include?(:action_mailer)
--    end
--  end
--end
--
--Rails::Plugin::Loader.send :include, PrependEngineViews
--
--- 

Copied: trunk/redmine/debian/patches/0008-Wrong-path-for-interpreter.patch (from rev 4614, trunk/redmine/debian/patches/0009-Wrong-path-for-interpreter.patch)
===================================================================
--- trunk/redmine/debian/patches/0008-Wrong-path-for-interpreter.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0008-Wrong-path-for-interpreter.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -0,0 +1,19 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sat, 9 Jan 2010 23:57:26 +0100
+Subject: [PATCH] Wrong path for interpreter.
+
+---
+ lib/faster_csv.rb |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/lib/faster_csv.rb b/lib/faster_csv.rb
+index 9c3a406..13a48ef 100644
+--- a/lib/faster_csv.rb
++++ b/lib/faster_csv.rb
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/ruby -w
++#!/usr/bin/ruby -w
+ 
+ # = faster_csv.rb -- Faster CSV Reading and Writing
+ #
+-- 

Copied: trunk/redmine/debian/patches/0009-Allows-environment-variables-to-setup-debian-paths.patch (from rev 4614, trunk/redmine/debian/patches/0010-Allows-environment-variables-to-setup-debian-paths.patch)
===================================================================
--- trunk/redmine/debian/patches/0009-Allows-environment-variables-to-setup-debian-paths.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0009-Allows-environment-variables-to-setup-debian-paths.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -0,0 +1,105 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sun, 10 Jan 2010 00:03:57 +0100
+Subject: [PATCH] Allows environment variables to setup debian paths.
+
+---
+ app/models/attachment.rb          |    2 +-
+ config/environment.rb             |   19 ++++++++++++++++++-
+ config/initializers/10-patches.rb |    3 +++
+ config/initializers/40-email.rb   |    2 +-
+ public/dispatch.fcgi.example      |    7 +++++--
+ 5 files changed, 28 insertions(+), 5 deletions(-)
+
+diff --git a/app/models/attachment.rb b/app/models/attachment.rb
+index e44b162..296d8b9 100644
+--- a/app/models/attachment.rb
++++ b/app/models/attachment.rb
+@@ -43,7 +43,7 @@ class Attachment < ActiveRecord::Base
+                                                         "LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"}
+ 
+   cattr_accessor :storage_path
+-  @@storage_path = "#{RAILS_ROOT}/files"
++  @@storage_path = ENV['RAILS_VAR'] ? File.join(ENV['RAILS_VAR'], 'files') : "#{RAILS_ROOT}/files"
+   
+   def validate
+     if self.filesize > Setting.attachment_max_size.to_i.kilobytes
+diff --git a/config/environment.rb b/config/environment.rb
+index 1f7d23e..a248e7e 100644
+--- a/config/environment.rb
++++ b/config/environment.rb
+@@ -2,7 +2,15 @@
+ 
+ # Uncomment below to force Rails into production mode when 
+ # you don't control web/app server and can't set it the proper way
+-# ENV['RAILS_ENV'] ||= 'production'
++ENV['RAILS_ENV'] ||= 'production'
++
++# for debian package : setup proper environment variables and paths
++# To run redmine as unprivileged user, see /usr/share/doc/redmine/README.Debian
++ENV['X_DEBIAN_SITEID'] ||= 'default'
++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']}"
+ 
+ # Specifies gem version of Rails to use when vendor/rails is not present
+ RAILS_GEM_VERSION = '2.2.3' unless defined? RAILS_GEM_VERSION
+@@ -30,9 +38,18 @@ Rails::Initializer.run do |config|
+   # (by default production uses :info, the others :debug)
+   # config.log_level = :debug
+ 
++  # log path
++  config.log_path = File.join(ENV['RAILS_LOG'], "#{ENV['RAILS_ENV']}.log") unless !ENV['RAILS_LOG']
++
+   # Enable page/fragment caching by setting a file-based store
+   # (remember to create the caching directory and make it readable to the application)
+   # config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
++
++  # the file cache store
++  config.cache_store = :file_store, ENV['RAILS_CACHE']
++  
++  # Set Active Record's database.yml path
++  config.database_configuration_file = File.join(ENV['RAILS_ETC'], 'database.yml') unless !ENV['RAILS_ETC']
+   
+   # Activate observers that should always be running
+   # config.active_record.observers = :cacher, :garbage_collector
+diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
+index cdc3bfd..2edbe7b 100644
+--- a/config/initializers/10-patches.rb
++++ b/config/initializers/10-patches.rb
+@@ -78,3 +78,6 @@ module AsynchronousMailer
+ end
+ 
+ ActionMailer::Base.send :include, AsynchronousMailer
++
++# the session store
++ActionController::Base.session_options[:tmpdir] = File.join(ENV['RAILS_VAR'], 'sessions') unless !ENV['RAILS_VAR']
+diff --git a/config/initializers/40-email.rb b/config/initializers/40-email.rb
+index 5b388ec..d7aba5c 100644
+--- a/config/initializers/40-email.rb
++++ b/config/initializers/40-email.rb
+@@ -1,7 +1,7 @@
+ # Loads action_mailer settings from email.yml
+ # and turns deliveries on if configuration file is found
+ 
+-filename = File.join(File.dirname(__FILE__), '..', 'email.yml')
++filename = ENV['RAILS_ETC'] ? File.join(ENV['RAILS_ETC'], 'email.yml') : File.join(File.dirname(__FILE__), '..', 'email.yml')
+ if File.file?(filename)
+   mailconfig = YAML::load_file(filename)
+ 
+diff --git a/public/dispatch.fcgi.example b/public/dispatch.fcgi.example
+index 664dbbb..d24a04b 100755
+--- a/public/dispatch.fcgi.example
++++ b/public/dispatch.fcgi.example
+@@ -20,5 +20,8 @@
+ #
+ require File.dirname(__FILE__) + "/../config/environment"
+ require 'fcgi_handler'
+-
+-RailsFCGIHandler.process!
++if ENV['RAILS_LOG']
++  RailsFCGIHandler.process! File.join(ENV['RAILS_LOG'], 'fastcgi.crash.log'), 20 
++else
++  RailsFCGIHandler.process!
++end
+-- 

Deleted: trunk/redmine/debian/patches/0009-Wrong-path-for-interpreter.patch
===================================================================
--- trunk/redmine/debian/patches/0009-Wrong-path-for-interpreter.patch	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/0009-Wrong-path-for-interpreter.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,19 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sat, 9 Jan 2010 23:57:26 +0100
-Subject: [PATCH] Wrong path for interpreter.
-
----
- lib/faster_csv.rb |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/lib/faster_csv.rb b/lib/faster_csv.rb
-index 9c3a406..13a48ef 100644
---- a/lib/faster_csv.rb
-+++ b/lib/faster_csv.rb
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/ruby -w
-+#!/usr/bin/ruby -w
- 
- # = faster_csv.rb -- Faster CSV Reading and Writing
- #
--- 

Deleted: trunk/redmine/debian/patches/0010-Allows-environment-variables-to-setup-debian-paths.patch
===================================================================
--- trunk/redmine/debian/patches/0010-Allows-environment-variables-to-setup-debian-paths.patch	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/0010-Allows-environment-variables-to-setup-debian-paths.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,105 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sun, 10 Jan 2010 00:03:57 +0100
-Subject: [PATCH] Allows environment variables to setup debian paths.
-
----
- app/models/attachment.rb          |    2 +-
- config/environment.rb             |   19 ++++++++++++++++++-
- config/initializers/10-patches.rb |    3 +++
- config/initializers/40-email.rb   |    2 +-
- public/dispatch.fcgi.example      |    7 +++++--
- 5 files changed, 28 insertions(+), 5 deletions(-)
-
-diff --git a/app/models/attachment.rb b/app/models/attachment.rb
-index e44b162..296d8b9 100644
---- a/app/models/attachment.rb
-+++ b/app/models/attachment.rb
-@@ -43,7 +43,7 @@ class Attachment < ActiveRecord::Base
-                                                         "LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"}
- 
-   cattr_accessor :storage_path
--  @@storage_path = "#{RAILS_ROOT}/files"
-+  @@storage_path = ENV['RAILS_VAR'] ? File.join(ENV['RAILS_VAR'], 'files') : "#{RAILS_ROOT}/files"
-   
-   def validate
-     if self.filesize > Setting.attachment_max_size.to_i.kilobytes
-diff --git a/config/environment.rb b/config/environment.rb
-index 1f7d23e..a248e7e 100644
---- a/config/environment.rb
-+++ b/config/environment.rb
-@@ -2,7 +2,15 @@
- 
- # Uncomment below to force Rails into production mode when 
- # you don't control web/app server and can't set it the proper way
--# ENV['RAILS_ENV'] ||= 'production'
-+ENV['RAILS_ENV'] ||= 'production'
-+
-+# for debian package : setup proper environment variables and paths
-+# To run redmine as unprivileged user, see /usr/share/doc/redmine/README.Debian
-+ENV['X_DEBIAN_SITEID'] ||= 'default'
-+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']}"
- 
- # Specifies gem version of Rails to use when vendor/rails is not present
- RAILS_GEM_VERSION = '2.2.3' unless defined? RAILS_GEM_VERSION
-@@ -30,9 +38,18 @@ Rails::Initializer.run do |config|
-   # (by default production uses :info, the others :debug)
-   # config.log_level = :debug
- 
-+  # log path
-+  config.log_path = File.join(ENV['RAILS_LOG'], "#{ENV['RAILS_ENV']}.log") unless !ENV['RAILS_LOG']
-+
-   # Enable page/fragment caching by setting a file-based store
-   # (remember to create the caching directory and make it readable to the application)
-   # config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
-+
-+  # the file cache store
-+  config.cache_store = :file_store, ENV['RAILS_CACHE']
-+  
-+  # Set Active Record's database.yml path
-+  config.database_configuration_file = File.join(ENV['RAILS_ETC'], 'database.yml') unless !ENV['RAILS_ETC']
-   
-   # Activate observers that should always be running
-   # config.active_record.observers = :cacher, :garbage_collector
-diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
-index cdc3bfd..2edbe7b 100644
---- a/config/initializers/10-patches.rb
-+++ b/config/initializers/10-patches.rb
-@@ -78,3 +78,6 @@ module AsynchronousMailer
- end
- 
- ActionMailer::Base.send :include, AsynchronousMailer
-+
-+# the session store
-+ActionController::Base.session_options[:tmpdir] = File.join(ENV['RAILS_VAR'], 'sessions') unless !ENV['RAILS_VAR']
-diff --git a/config/initializers/40-email.rb b/config/initializers/40-email.rb
-index 5b388ec..d7aba5c 100644
---- a/config/initializers/40-email.rb
-+++ b/config/initializers/40-email.rb
-@@ -1,7 +1,7 @@
- # Loads action_mailer settings from email.yml
- # and turns deliveries on if configuration file is found
- 
--filename = File.join(File.dirname(__FILE__), '..', 'email.yml')
-+filename = ENV['RAILS_ETC'] ? File.join(ENV['RAILS_ETC'], 'email.yml') : File.join(File.dirname(__FILE__), '..', 'email.yml')
- if File.file?(filename)
-   mailconfig = YAML::load_file(filename)
- 
-diff --git a/public/dispatch.fcgi.example b/public/dispatch.fcgi.example
-index 664dbbb..d24a04b 100755
---- a/public/dispatch.fcgi.example
-+++ b/public/dispatch.fcgi.example
-@@ -20,5 +20,8 @@
- #
- require File.dirname(__FILE__) + "/../config/environment"
- require 'fcgi_handler'
--
--RailsFCGIHandler.process!
-+if ENV['RAILS_LOG']
-+  RailsFCGIHandler.process! File.join(ENV['RAILS_LOG'], 'fastcgi.crash.log'), 20 
-+else
-+  RailsFCGIHandler.process!
-+end
--- 

Copied: trunk/redmine/debian/patches/0010-Move-session-configuration-to-YML-file-next-to-datab.patch (from rev 4614, trunk/redmine/debian/patches/0011-Move-session-configuration-to-YML-file-next-to-datab.patch)
===================================================================
--- trunk/redmine/debian/patches/0010-Move-session-configuration-to-YML-file-next-to-datab.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0010-Move-session-configuration-to-YML-file-next-to-datab.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -0,0 +1,79 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sun, 10 Jan 2010 00:30:02 +0100
+Subject: [PATCH] Move session configuration to YML file, next to database.yml path.
+
+---
+ config/initializers/50-session.rb |   11 +++++++++++
+ lib/tasks/initializers.rake       |   35 +++++++++++++++++++++--------------
+ 2 files changed, 32 insertions(+), 14 deletions(-)
+ create mode 100644 config/initializers/50-session.rb
+
+diff --git a/config/initializers/50-session.rb b/config/initializers/50-session.rb
+new file mode 100644
+index 0000000..34707c5
+--- /dev/null
++++ b/config/initializers/50-session.rb
+@@ -0,0 +1,11 @@
++# loads cookie based session session and secret keys
++# crash if file not found
++
++filename = ENV['RAILS_ETC'] ? File.join(ENV['RAILS_ETC'], 'session.yml') : File.join(File.dirname(__FILE__), '..', 'session.yml')
++sessionconfig = YAML::load_file(filename)
++
++ActionController::Base.session = {
++  :session_key => sessionconfig[Rails.env]['session_key'],
++  :secret => sessionconfig[Rails.env]['secret'],
++  :session_path => ENV['RAILS_RELATIVE_URL_ROOT'] ? ENV['RAILS_RELATIVE_URL_ROOT'] : '/'
++}
+diff --git a/lib/tasks/initializers.rake b/lib/tasks/initializers.rake
+index ce87475..058798a 100644
+--- a/lib/tasks/initializers.rake
++++ b/lib/tasks/initializers.rake
+@@ -1,11 +1,14 @@
+ desc 'Generates a configuration file for cookie store sessions.'
++task :generate_session_store
+ 
+-file 'config/initializers/session_store.rb' do
+-  path = File.join(RAILS_ROOT, 'config', 'initializers', 'session_store.rb')
+-  secret = ActiveSupport::SecureRandom.hex(40)
+-  File.open(path, 'w') do |f|
+-    f.write <<"EOF"
+-# This file was generated by 'rake config/initializers/session_store.rb',
++ENV['X_DEBIAN_SITEID'] ||= 'default'
++ENV['RAILS_ETC'] ||= "/etc/redmine/#{ENV['X_DEBIAN_SITEID']}"
++filename = ENV['YML_SESSION_FILENAME'] ? ENV['YML_SESSION_FILENAME'] : 'session.yml'
++path = File.join(ENV['RAILS_ETC'] ? ENV['RAILS_ETC'] : File.join(RAILS_ROOT, 'config'), filename)
++secret = ActiveSupport::SecureRandom.hex(40)
++File.open(path, 'w') do |f|
++  f.write <<"EOF"
++# This file was generated by 'rake generate_session_store',
+ # and should not be made visible to public.
+ # If you have a load-balancing Redmine cluster, you will need to use the
+ # same version of this file on each machine. And be sure to restart your
+@@ -15,13 +18,17 @@ file 'config/initializers/session_store.rb' do
+ # change this key, all old sessions will become invalid! Make sure the
+ # secret is at least 30 characters and all random, no regular words or
+ # you'll be exposed to dictionary attacks.
+-ActionController::Base.session = {
+-  :session_key => '_redmine_session',
+-  :secret => '#{secret}'
+-}
++production:
++  session_key: _redmine_#{ENV['X_DEBIAN_SITEID']}
++  secret: #{secret}
++
++development:
++  session_key: _redmine_#{ENV['X_DEBIAN_SITEID']}
++  secret: #{secret}
++
++test:
++  session_key: _redmine_#{ENV['X_DEBIAN_SITEID']}
++  secret: #{secret}
++
+ EOF
+-  end
+ end
+-
+-desc 'Generates a configuration file for cookie store sessions.'
+-task :generate_session_store => ['config/initializers/session_store.rb']
+-- 

Copied: trunk/redmine/debian/patches/0011-Duplicate-name-value-in-request.patch (from rev 4614, trunk/redmine/debian/patches/0012-Duplicate-name-value-in-request.patch)
===================================================================
--- trunk/redmine/debian/patches/0011-Duplicate-name-value-in-request.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0011-Duplicate-name-value-in-request.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -0,0 +1,42 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sat, 16 Jan 2010 17:16:40 +0100
+Subject: [PATCH] Duplicate name value in request
+
+In rails 2.2, when two inputs have the same name, only the first one's value will be considered. It's best if the hidden input is rejected after the main input, and ignored by rails 2.2.
+---
+ app/helpers/settings_helper.rb |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb
+index e57b75f..a5d8355 100644
+--- a/app/helpers/settings_helper.rb
++++ b/app/helpers/settings_helper.rb
+@@ -41,14 +41,14 @@ module SettingsHelper
+     setting_values = [] unless setting_values.is_a?(Array)
+       
+     setting_label(setting, options) +
+-      hidden_field_tag("settings[#{setting}][]", '') +
+       choices.collect do |choice|
+         text, value = (choice.is_a?(Array) ? choice : [choice, choice]) 
+         content_tag('label',
+           check_box_tag("settings[#{setting}][]", value, Setting.send(setting).include?(value)) + text.to_s,
+           :class => 'block'
+         )
+-      end.join
++      end.join +
++      hidden_field_tag("settings[#{setting}][]", '')
+   end
+   
+   def setting_text_field(setting, options={})
+@@ -63,8 +63,8 @@ module SettingsHelper
+   
+   def setting_check_box(setting, options={})
+     setting_label(setting, options) +
+-      hidden_field_tag("settings[#{setting}]", 0) +
+-      check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options)
++      check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options) +
++      hidden_field_tag("settings[#{setting}]", 0)
+   end
+   
+   def setting_label(setting, options={})
+-- 

Deleted: trunk/redmine/debian/patches/0011-Move-session-configuration-to-YML-file-next-to-datab.patch
===================================================================
--- trunk/redmine/debian/patches/0011-Move-session-configuration-to-YML-file-next-to-datab.patch	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/0011-Move-session-configuration-to-YML-file-next-to-datab.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,79 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sun, 10 Jan 2010 00:30:02 +0100
-Subject: [PATCH] Move session configuration to YML file, next to database.yml path.
-
----
- config/initializers/50-session.rb |   11 +++++++++++
- lib/tasks/initializers.rake       |   35 +++++++++++++++++++++--------------
- 2 files changed, 32 insertions(+), 14 deletions(-)
- create mode 100644 config/initializers/50-session.rb
-
-diff --git a/config/initializers/50-session.rb b/config/initializers/50-session.rb
-new file mode 100644
-index 0000000..34707c5
---- /dev/null
-+++ b/config/initializers/50-session.rb
-@@ -0,0 +1,11 @@
-+# loads cookie based session session and secret keys
-+# crash if file not found
-+
-+filename = ENV['RAILS_ETC'] ? File.join(ENV['RAILS_ETC'], 'session.yml') : File.join(File.dirname(__FILE__), '..', 'session.yml')
-+sessionconfig = YAML::load_file(filename)
-+
-+ActionController::Base.session = {
-+  :session_key => sessionconfig[Rails.env]['session_key'],
-+  :secret => sessionconfig[Rails.env]['secret'],
-+  :session_path => ENV['RAILS_RELATIVE_URL_ROOT'] ? ENV['RAILS_RELATIVE_URL_ROOT'] : '/'
-+}
-diff --git a/lib/tasks/initializers.rake b/lib/tasks/initializers.rake
-index ce87475..058798a 100644
---- a/lib/tasks/initializers.rake
-+++ b/lib/tasks/initializers.rake
-@@ -1,11 +1,14 @@
- desc 'Generates a configuration file for cookie store sessions.'
-+task :generate_session_store
- 
--file 'config/initializers/session_store.rb' do
--  path = File.join(RAILS_ROOT, 'config', 'initializers', 'session_store.rb')
--  secret = ActiveSupport::SecureRandom.hex(40)
--  File.open(path, 'w') do |f|
--    f.write <<"EOF"
--# This file was generated by 'rake config/initializers/session_store.rb',
-+ENV['X_DEBIAN_SITEID'] ||= 'default'
-+ENV['RAILS_ETC'] ||= "/etc/redmine/#{ENV['X_DEBIAN_SITEID']}"
-+filename = ENV['YML_SESSION_FILENAME'] ? ENV['YML_SESSION_FILENAME'] : 'session.yml'
-+path = File.join(ENV['RAILS_ETC'] ? ENV['RAILS_ETC'] : File.join(RAILS_ROOT, 'config'), filename)
-+secret = ActiveSupport::SecureRandom.hex(40)
-+File.open(path, 'w') do |f|
-+  f.write <<"EOF"
-+# This file was generated by 'rake generate_session_store',
- # and should not be made visible to public.
- # If you have a load-balancing Redmine cluster, you will need to use the
- # same version of this file on each machine. And be sure to restart your
-@@ -15,13 +18,17 @@ file 'config/initializers/session_store.rb' do
- # change this key, all old sessions will become invalid! Make sure the
- # secret is at least 30 characters and all random, no regular words or
- # you'll be exposed to dictionary attacks.
--ActionController::Base.session = {
--  :session_key => '_redmine_session',
--  :secret => '#{secret}'
--}
-+production:
-+  session_key: _redmine_#{ENV['X_DEBIAN_SITEID']}
-+  secret: #{secret}
-+
-+development:
-+  session_key: _redmine_#{ENV['X_DEBIAN_SITEID']}
-+  secret: #{secret}
-+
-+test:
-+  session_key: _redmine_#{ENV['X_DEBIAN_SITEID']}
-+  secret: #{secret}
-+
- EOF
--  end
- end
--
--desc 'Generates a configuration file for cookie store sessions.'
--task :generate_session_store => ['config/initializers/session_store.rb']
--- 

Deleted: trunk/redmine/debian/patches/0012-Duplicate-name-value-in-request.patch
===================================================================
--- trunk/redmine/debian/patches/0012-Duplicate-name-value-in-request.patch	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/0012-Duplicate-name-value-in-request.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,42 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sat, 16 Jan 2010 17:16:40 +0100
-Subject: [PATCH] Duplicate name value in request
-
-In rails 2.2, when two inputs have the same name, only the first one's value will be considered. It's best if the hidden input is rejected after the main input, and ignored by rails 2.2.
----
- app/helpers/settings_helper.rb |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb
-index e57b75f..a5d8355 100644
---- a/app/helpers/settings_helper.rb
-+++ b/app/helpers/settings_helper.rb
-@@ -41,14 +41,14 @@ module SettingsHelper
-     setting_values = [] unless setting_values.is_a?(Array)
-       
-     setting_label(setting, options) +
--      hidden_field_tag("settings[#{setting}][]", '') +
-       choices.collect do |choice|
-         text, value = (choice.is_a?(Array) ? choice : [choice, choice]) 
-         content_tag('label',
-           check_box_tag("settings[#{setting}][]", value, Setting.send(setting).include?(value)) + text.to_s,
-           :class => 'block'
-         )
--      end.join
-+      end.join +
-+      hidden_field_tag("settings[#{setting}][]", '')
-   end
-   
-   def setting_text_field(setting, options={})
-@@ -63,8 +63,8 @@ module SettingsHelper
-   
-   def setting_check_box(setting, options={})
-     setting_label(setting, options) +
--      hidden_field_tag("settings[#{setting}]", 0) +
--      check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options)
-+      check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options) +
-+      hidden_field_tag("settings[#{setting}]", 0)
-   end
-   
-   def setting_label(setting, options={})
--- 

Copied: trunk/redmine/debian/patches/0012-REST-API-for-my-account.patch (from rev 4614, trunk/redmine/debian/patches/0013-REST-API-for-my-account.patch)
===================================================================
--- trunk/redmine/debian/patches/0012-REST-API-for-my-account.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0012-REST-API-for-my-account.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -0,0 +1,54 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sat, 16 Jan 2010 18:21:50 +0100
+Subject: [PATCH] REST API for my/account
+
+This allows my/account.(json|xml) to return User.current.
+---
+ app/controllers/my_controller.rb |    8 ++++++--
+ config/routes.rb                 |    6 ++++++
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
+index f686759..f960951 100644
+--- a/app/controllers/my_controller.rb
++++ b/app/controllers/my_controller.rb
+@@ -17,7 +17,7 @@
+ 
+ class MyController < ApplicationController
+   before_filter :require_login
+-
++  accept_key_auth :index
+   helper :issues
+   helper :custom_fields
+ 
+@@ -39,7 +39,11 @@ class MyController < ApplicationController
+ 
+   def index
+     page
+-    render :action => 'page'
++    respond_to do |format|
++      format.html { render :action => 'page' }
++      format.xml { render :xml => @user.to_xml }
++      format.json { render :json => @user.to_json }
++    end
+   end
+ 
+   # Show user's page
+diff --git a/config/routes.rb b/config/routes.rb
+index e2560c1..4bca52e 100644
+--- a/config/routes.rb
++++ b/config/routes.rb
+@@ -17,6 +17,12 @@ ActionController::Routing::Routes.draw do |map|
+   map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog'
+   map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog'
+   map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog'
++
++  map.with_options :controller => 'my' do |my_routes|
++    my_routes.with_options :conditions => {:method => :get} do |my_views|
++      my_views.connect 'my/account.:format', :action => 'index'
++    end
++  end
+   
+   map.with_options :controller => 'timelog' do |timelog|
+     timelog.connect 'projects/:project_id/time_entries', :action => 'details'
+-- 

Deleted: trunk/redmine/debian/patches/0013-REST-API-for-my-account.patch
===================================================================
--- trunk/redmine/debian/patches/0013-REST-API-for-my-account.patch	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/0013-REST-API-for-my-account.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,54 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sat, 16 Jan 2010 18:21:50 +0100
-Subject: [PATCH] REST API for my/account
-
-This allows my/account.(json|xml) to return User.current.
----
- app/controllers/my_controller.rb |    8 ++++++--
- config/routes.rb                 |    6 ++++++
- 2 files changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
-index f686759..f960951 100644
---- a/app/controllers/my_controller.rb
-+++ b/app/controllers/my_controller.rb
-@@ -17,7 +17,7 @@
- 
- class MyController < ApplicationController
-   before_filter :require_login
--
-+  accept_key_auth :index
-   helper :issues
-   helper :custom_fields
- 
-@@ -39,7 +39,11 @@ class MyController < ApplicationController
- 
-   def index
-     page
--    render :action => 'page'
-+    respond_to do |format|
-+      format.html { render :action => 'page' }
-+      format.xml { render :xml => @user.to_xml }
-+      format.json { render :json => @user.to_json }
-+    end
-   end
- 
-   # Show user's page
-diff --git a/config/routes.rb b/config/routes.rb
-index e2560c1..4bca52e 100644
---- a/config/routes.rb
-+++ b/config/routes.rb
-@@ -17,6 +17,12 @@ ActionController::Routing::Routes.draw do |map|
-   map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog'
-   map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog'
-   map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog'
-+
-+  map.with_options :controller => 'my' do |my_routes|
-+    my_routes.with_options :conditions => {:method => :get} do |my_views|
-+      my_views.connect 'my/account.:format', :action => 'index'
-+    end
-+  end
-   
-   map.with_options :controller => 'timelog' do |timelog|
-     timelog.connect 'projects/:project_id/time_entries', :action => 'details'
--- 

Copied: trunk/redmine/debian/patches/0013-Sanitize-textarea-id-for-rails2.2.patch (from rev 4614, trunk/redmine/debian/patches/0014-Sanitize-textarea-id-for-rails2.2.patch)
===================================================================
--- trunk/redmine/debian/patches/0013-Sanitize-textarea-id-for-rails2.2.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0013-Sanitize-textarea-id-for-rails2.2.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -0,0 +1,66 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sun, 17 Jan 2010 15:18:41 +0100
+Subject: [PATCH] Sanitize textarea id for rails2.2
+
+In rails 2.2, the id attribute of a textarea is not sanitized as it is for other form tags. Fix this using a minimal monkey patch from rails 2.3.
+---
+ .../initializers/text_field_helper_santitize_id.rb |   49 ++++++++++++++++++++
+ 1 files changed, 49 insertions(+), 0 deletions(-)
+ create mode 100644 config/initializers/text_field_helper_santitize_id.rb
+
+diff --git a/config/initializers/text_field_helper_santitize_id.rb b/config/initializers/text_field_helper_santitize_id.rb
+new file mode 100644
+index 0000000..429c806
+--- /dev/null
++++ b/config/initializers/text_field_helper_santitize_id.rb
+@@ -0,0 +1,49 @@
++require 'action_view/helpers/tag_helper'
++
++module ActionView
++  module Helpers
++    module FormTagHelper
++      # Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions.
++      #
++      # ==== Options
++      # * <tt>:size</tt> - A string specifying the dimensions (columns by rows) of the textarea (e.g., "25x10").
++      # * <tt>:rows</tt> - Specify the number of rows in the textarea
++      # * <tt>:cols</tt> - Specify the number of columns in the textarea
++      # * <tt>:disabled</tt> - If set to true, the user will not be able to use this input.
++      # * <tt>:escape</tt> - By default, the contents of the text input are HTML escaped.
++      #   If you need unescaped contents, set this to false.
++      # * Any other key creates standard HTML attributes for the tag.
++      #
++      # ==== Examples
++      #   text_area_tag 'post'
++      #   # => <textarea id="post" name="post"></textarea>
++      #
++      #   text_area_tag 'bio', @user.bio
++      #   # => <textarea id="bio" name="bio">This is my biography.</textarea>
++      #
++      #   text_area_tag 'body', nil, :rows => 10, :cols => 25
++      #   # => <textarea cols="25" id="body" name="body" rows="10"></textarea>
++      #
++      #   text_area_tag 'body', nil, :size => "25x10"
++      #   # => <textarea name="body" id="body" cols="25" rows="10"></textarea>
++      #
++      #   text_area_tag 'description', "Description goes here.", :disabled => true
++      #   # => <textarea disabled="disabled" id="description" name="description">Description goes here.</textarea>
++      #
++      #   text_area_tag 'comment', nil, :class => 'comment_input'
++      #   # => <textarea class="comment_input" id="comment" name="comment"></textarea>
++      def text_area_tag(name, content = nil, options = {})
++        options.stringify_keys!
++
++        if size = options.delete("size")
++          options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split)
++        end
++
++        escape = options.key?("escape") ? options.delete("escape") : true
++        content = html_escape(content) if escape
++
++        content_tag :textarea, content, { "name" => name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)
++      end
++    end
++  end
++end
+-- 

Copied: trunk/redmine/debian/patches/0014-OrderedHash-to-Hash.patch (from rev 4614, trunk/redmine/debian/patches/0015-OrderedHash-to-Hash.patch)
===================================================================
--- trunk/redmine/debian/patches/0014-OrderedHash-to-Hash.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0014-OrderedHash-to-Hash.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -0,0 +1,23 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Thu, 21 Jan 2010 09:38:43 +0100
+Subject: [PATCH] OrderedHash to Hash
+
+Since in rails 2.2 OrderedHash < Array, not < Hash.
+---
+ app/models/issue.rb |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/app/models/issue.rb b/app/models/issue.rb
+index f4ebb29..4146547 100644
+--- a/app/models/issue.rb
++++ b/app/models/issue.rb
+@@ -157,7 +157,7 @@ class Issue < ActiveRecord::Base
+     if new_tracker_id
+       self.tracker_id = new_tracker_id
+     end
+-    send :attributes_without_tracker_first=, new_attributes, *args
++    send :attributes_without_tracker_first=, new_attributes.to_hash, *args
+   end
+   alias_method_chain :attributes=, :tracker_first
+   
+-- 

Deleted: trunk/redmine/debian/patches/0014-Sanitize-textarea-id-for-rails2.2.patch
===================================================================
--- trunk/redmine/debian/patches/0014-Sanitize-textarea-id-for-rails2.2.patch	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/0014-Sanitize-textarea-id-for-rails2.2.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,66 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Sun, 17 Jan 2010 15:18:41 +0100
-Subject: [PATCH] Sanitize textarea id for rails2.2
-
-In rails 2.2, the id attribute of a textarea is not sanitized as it is for other form tags. Fix this using a minimal monkey patch from rails 2.3.
----
- .../initializers/text_field_helper_santitize_id.rb |   49 ++++++++++++++++++++
- 1 files changed, 49 insertions(+), 0 deletions(-)
- create mode 100644 config/initializers/text_field_helper_santitize_id.rb
-
-diff --git a/config/initializers/text_field_helper_santitize_id.rb b/config/initializers/text_field_helper_santitize_id.rb
-new file mode 100644
-index 0000000..429c806
---- /dev/null
-+++ b/config/initializers/text_field_helper_santitize_id.rb
-@@ -0,0 +1,49 @@
-+require 'action_view/helpers/tag_helper'
-+
-+module ActionView
-+  module Helpers
-+    module FormTagHelper
-+      # Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions.
-+      #
-+      # ==== Options
-+      # * <tt>:size</tt> - A string specifying the dimensions (columns by rows) of the textarea (e.g., "25x10").
-+      # * <tt>:rows</tt> - Specify the number of rows in the textarea
-+      # * <tt>:cols</tt> - Specify the number of columns in the textarea
-+      # * <tt>:disabled</tt> - If set to true, the user will not be able to use this input.
-+      # * <tt>:escape</tt> - By default, the contents of the text input are HTML escaped.
-+      #   If you need unescaped contents, set this to false.
-+      # * Any other key creates standard HTML attributes for the tag.
-+      #
-+      # ==== Examples
-+      #   text_area_tag 'post'
-+      #   # => <textarea id="post" name="post"></textarea>
-+      #
-+      #   text_area_tag 'bio', @user.bio
-+      #   # => <textarea id="bio" name="bio">This is my biography.</textarea>
-+      #
-+      #   text_area_tag 'body', nil, :rows => 10, :cols => 25
-+      #   # => <textarea cols="25" id="body" name="body" rows="10"></textarea>
-+      #
-+      #   text_area_tag 'body', nil, :size => "25x10"
-+      #   # => <textarea name="body" id="body" cols="25" rows="10"></textarea>
-+      #
-+      #   text_area_tag 'description', "Description goes here.", :disabled => true
-+      #   # => <textarea disabled="disabled" id="description" name="description">Description goes here.</textarea>
-+      #
-+      #   text_area_tag 'comment', nil, :class => 'comment_input'
-+      #   # => <textarea class="comment_input" id="comment" name="comment"></textarea>
-+      def text_area_tag(name, content = nil, options = {})
-+        options.stringify_keys!
-+
-+        if size = options.delete("size")
-+          options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split)
-+        end
-+
-+        escape = options.key?("escape") ? options.delete("escape") : true
-+        content = html_escape(content) if escape
-+
-+        content_tag :textarea, content, { "name" => name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)
-+      end
-+    end
-+  end
-+end
--- 

Copied: trunk/redmine/debian/patches/0015-Monkey-patches-for-group-support-taken-from-rails-2..patch (from rev 4614, trunk/redmine/debian/patches/0004-Monkey-patches-for-group-support-taken-from-rails-2..patch)
===================================================================
--- trunk/redmine/debian/patches/0015-Monkey-patches-for-group-support-taken-from-rails-2..patch	                        (rev 0)
+++ trunk/redmine/debian/patches/0015-Monkey-patches-for-group-support-taken-from-rails-2..patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -0,0 +1,85 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sat, 9 Jan 2010 23:30:15 +0100
+Subject: [PATCH] Monkey patches for group support, taken from rails 2.3.
+
+---
+ config/initializers/action_group.rb |   69 +++++++++++++++++++++++++++++++++++
+ 1 files changed, 69 insertions(+), 0 deletions(-)
+ create mode 100644 config/initializers/action_group.rb
+
+diff --git a/config/initializers/action_group.rb b/config/initializers/action_group.rb
+new file mode 100644
+index 0000000..0adfd78
+--- /dev/null
++++ b/config/initializers/action_group.rb
+@@ -0,0 +1,69 @@
++module ActionView
++  module Helpers
++    module FormOptionsHelper
++      def options_for_select(container, selected = nil)
++        return container if String === container
++
++        container = container.to_a if Hash === container
++        selected, disabled = extract_selected_and_disabled(selected)
++
++        options_for_select = container.inject([]) do |options, element|
++          text, value = option_text_and_value(element)
++          selected_attribute = ' selected="selected"' if option_value_selected?(value, selected)
++          disabled_attribute = ' disabled="disabled"' if disabled && option_value_selected?(value, disabled)
++          options << %(<option value="#{html_escape(value.to_s)}"#{selected_attribute}#{disabled_attribute}>#{html_escape(text.to_s)}</option>)
++        end
++
++        options_for_select.join("\n")
++      end
++      def extract_selected_and_disabled(selected)
++          if selected.is_a?(Hash)
++            [selected[:selected], selected[:disabled]]
++          else
++            [selected, nil]
++          end
++        end
++      def grouped_options_for_select(grouped_options, selected_key = nil, prompt = nil)
++        body = ''
++        body << content_tag(:option, prompt, :value => "") if prompt
++        grouped_options = grouped_options.sort if grouped_options.is_a?(Hash)
++        grouped_options.each do |group|
++          body << content_tag(:optgroup, options_for_select(group[1], selected_key), :label => group[0])
++        end
++        body
++      end
++    end
++  end
++
++  require 'action_view/test_case'
++  require 'action_controller/test_process'
++  class FormOptionsHelperTest < ActionView::TestCase
++    def test_grouped_options_for_select_with_array
++      assert_dom_equal(
++            "<optgroup label=\"North America\"><option value=\"US\">United States</option>\n<option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\"><option value=\"GB\">Great Britain</option>\n<option value=\"Germany\">Germany</option></optgroup>",
++            grouped_options_for_select([
++               ["North America",
++                       [['United States','US'],"Canada"]],
++               ["Europe",
++                       [["Great Britain","GB"], "Germany"]]
++             ])
++      )
++    end
++
++    def test_grouped_options_for_select_with_selected_and_prompt
++      assert_dom_equal(
++              "<option value=\"\">Choose a product...</option><optgroup label=\"Hats\"><option value=\"Baseball Cap\">Baseball Cap</option>\n<option selected=\"selected\" value=\"Cowboy Hat\">Cowboy Hat</option></optgroup>",
++              grouped_options_for_select([["Hats", ["Baseball Cap","Cowboy Hat"]]], "Cowboy Hat", "Choose a product...")
++      )
++    end
++
++    def test_optgroups_with_with_options_with_hash
++      assert_dom_equal(
++             "<optgroup label=\"Europe\"><option value=\"Denmark\">Denmark</option>\n<option value=\"Germany\">Germany</option></optgroup><optgroup label=\"North America\"><option value=\"United States\">United States</option>\n<option value=\"Canada\">Canada</option></optgroup>",
++             grouped_options_for_select({'North America' => ['United States','Canada'], 'Europe' => ['Denmark','Germany']})
++      )
++    end
++  end
++end
++
++
+-- 

Deleted: trunk/redmine/debian/patches/0015-OrderedHash-to-Hash.patch
===================================================================
--- trunk/redmine/debian/patches/0015-OrderedHash-to-Hash.patch	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/0015-OrderedHash-to-Hash.patch	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,23 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
-Date: Thu, 21 Jan 2010 09:38:43 +0100
-Subject: [PATCH] OrderedHash to Hash
-
-Since in rails 2.2 OrderedHash < Array, not < Hash.
----
- app/models/issue.rb |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/app/models/issue.rb b/app/models/issue.rb
-index f4ebb29..4146547 100644
---- a/app/models/issue.rb
-+++ b/app/models/issue.rb
-@@ -157,7 +157,7 @@ class Issue < ActiveRecord::Base
-     if new_tracker_id
-       self.tracker_id = new_tracker_id
-     end
--    send :attributes_without_tracker_first=, new_attributes, *args
-+    send :attributes_without_tracker_first=, new_attributes.to_hash, *args
-   end
-   alias_method_chain :attributes=, :tracker_first
-   
--- 

Modified: trunk/redmine/debian/patches/series
===================================================================
--- trunk/redmine/debian/patches/series	2010-02-08 13:09:00 UTC (rev 4614)
+++ trunk/redmine/debian/patches/series	2010-02-10 00:44:52 UTC (rev 4615)
@@ -1,15 +1,15 @@
 0001-Revert-this-default_scope-rails-2.3-usage.patch
 0002-Revert-rails-2.3-changes-in-mailer.patch
 0003-Depends-on-rails-2.2.3.patch
-0004-Monkey-patches-for-group-support-taken-from-rails-2..patch
-0005-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch
-0006-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch
-0007-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch
-0008-Revert-this-rails-2.3-plugin.patch
-0009-Wrong-path-for-interpreter.patch
-0010-Allows-environment-variables-to-setup-debian-paths.patch
-0011-Move-session-configuration-to-YML-file-next-to-datab.patch
-0012-Duplicate-name-value-in-request.patch
-0013-REST-API-for-my-account.patch
-0014-Sanitize-textarea-id-for-rails2.2.patch
-0015-OrderedHash-to-Hash.patch
+0004-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch
+0005-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch
+0006-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch
+0007-Revert-this-rails-2.3-plugin.patch
+0008-Wrong-path-for-interpreter.patch
+0009-Allows-environment-variables-to-setup-debian-paths.patch
+0010-Move-session-configuration-to-YML-file-next-to-datab.patch
+0011-Duplicate-name-value-in-request.patch
+0012-REST-API-for-my-account.patch
+0013-Sanitize-textarea-id-for-rails2.2.patch
+0014-OrderedHash-to-Hash.patch
+0015-Monkey-patches-for-group-support-taken-from-rails-2..patch




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