[DRE-commits] r4520 - in trunk/redmine/debian: . patches
Jérémy Lal
kapouer-guest at alioth.debian.org
Sun Jan 10 02:38:43 UTC 2010
Author: kapouer-guest
Date: 2010-01-10 02:38:43 +0000 (Sun, 10 Jan 2010)
New Revision: 4520
Added:
trunk/redmine/debian/patches/0001-Revert-this-default_scope-rails-2.3-usage.patch
trunk/redmine/debian/patches/0002-Revert-rails-2.3-changes-in-mailer.patch
trunk/redmine/debian/patches/0003-Depends-on-rails-2.2.3.patch
trunk/redmine/debian/patches/0004-Monkey-patches-for-group-support-taken-from-rails-2..patch
trunk/redmine/debian/patches/0005-Converts-OrderedHash-to-Hash-using-to_hash-since-in-.patch
trunk/redmine/debian/patches/0006-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch
trunk/redmine/debian/patches/0007-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch
trunk/redmine/debian/patches/0008-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch
trunk/redmine/debian/patches/0009-Revert-this-rails-2.3-plugin.patch
trunk/redmine/debian/patches/0010-Wrong-path-for-interpreter.patch
trunk/redmine/debian/patches/0011-Allows-environment-variables-to-setup-debian-paths.patch
trunk/redmine/debian/patches/0012-Move-session-configuration-to-YML-file-next-to-datab.patch
Removed:
trunk/redmine/debian/patches/01_paths.patch
trunk/redmine/debian/patches/02_session_path.patch
trunk/redmine/debian/patches/revert_rails_2.3.patch
trunk/redmine/debian/patches/wrong_path_for_interpreter.patch
Modified:
trunk/redmine/debian/README.Debian
trunk/redmine/debian/README.source
trunk/redmine/debian/TODO
trunk/redmine/debian/changelog
trunk/redmine/debian/patches/series
trunk/redmine/debian/postinst
trunk/redmine/debian/postrm
Log:
* Split debian/patches
* Move session configuration to session.yml
* Generates session configuration file at install time, track it with ucf, move and desactivate old session_store.rb
* Adds explanations and support on how to run as unprivileged user.
* Prepare for release
Modified: trunk/redmine/debian/README.Debian
===================================================================
--- trunk/redmine/debian/README.Debian 2010-01-09 23:51:17 UTC (rev 4519)
+++ trunk/redmine/debian/README.Debian 2010-01-10 02:38:43 UTC (rev 4520)
@@ -1,24 +1,40 @@
redmine for Debian
------------------
-* REDMINE GUIDE
- http://www.redmine.org/wiki/redmine/Guide
+* REDMINE 0.9 PATCHED FOR RAILS 2.2 COMPATIBILITY
+ rails 2.3 is not currently available in debian. This redmine 0.9 version has been
+ patched to be able to run with rails 2.2. There are some drawbacks :
+ - prepend_engine_views plugin is removed,
+ so any third-party plugin depending on it will fail.
+ - login then logout does not clear session (this is rails 2.2 failure)
+ - REST web service partially working, e.g.
+ get /news.json with a valid HTTP authentication does not login as the user.
* SUPPORTS SETUP AND UPGRADES OF MULTIPLE DATABASE INSTANCES
This redmine package is designed to automatically configure database
BUT NOT the web server.
- A debconf facility is provided to be able to configure several redmine
+ The default database instance is called "default".
+ A debconf facility is provided for configuring several redmine
instances. Use dpkg-reconfigure to define the instances identifiers.
+ NOTICE : every rake command has to know which instance it applies to.
+ TO SELECT THE INSTANCE, USE
+ X_DEBIAN_SITEID=<instancename>
+ BEFORE ANY RAKE TASK.
+
+ Example : (run the imap mail receiver)
+sudo -u www-data X_DEBIAN_SITEID=default RAILS_ENV=production \
+rake -f /usr/share/redmine/Rakefile \
+redmine:email:receive_imap \
+host=imap.test.com \
+username=test at test.com password=xxxxxx
-* SUPPORTS MIGRATION FROM THE VERSION ON DEBIAN MENTORS
- Note for users of previous, unreleased redmine debian packages :
- the old configuration is moved to the "default" instance.
+* REDMINE GUIDE
+ http://www.redmine.org/wiki/redmine/Guide
* REMEMBER TO CHANGE THE DEFAULT ADMIN PASSWORD
By default, redmine admin account log/pass is admin/admin
* MANUAL WEB SERVER CONFIGURATION
- For web server configuration, examples are
- available in /usr/share/doc/redmine/examples
+ For web server configuration, examples are available in /usr/share/doc/redmine/examples
To choose which instance to run, set the environment variable :
X_DEBIAN_SITEID=<instancename>
By default,
@@ -32,19 +48,70 @@
used with "rewrite" and "fcgid" modules. The "fastcgi" module is bound to
be deprecated, since
"mod_fcgid is now included in Apache httpd 2.3 source code", see
- http://fastcgi.coremail.cn/
+ http://fastcgi.coremail.cn/
* QUICK LAUNCH USING WEBRICK
To test redmine without installing a web server, run as root :
cd /usr/share/redmine/
sudo -u www-data X_DEBIAN_SITEID="default" ruby script/server webrick -e production
and point your browser to http://localhost:3000
+ NOTICE : running without sudoing to www-data will change permissions on some files, e.g.
+ /var/log/redmine files. Fix it or reinstall the redmine package if you did so.
+ * OWNERS AND PERMISSIONS
+ It is assumed ruby will run redmine as www-data:www-data.
+ Accordingly, these files are owned by root:www-data and have 640 permissions :
+ /usr/share/redmine/config/initializers/session_store.rb
+ /etc/redmine/<instancename>/database.yml
+ /etc/redmine/<instancename>/email.yml
+ These folders are owned by www-data:www-data and have 750 permissions :
+ /var/log/redmine/*
+ /var/lib/redmine/*
+ /var/cache/redmine/*
+
+ Relaxing those permissions is discouraged. Please think twice before doing so.
+ If one really need to run redmine as another user, please read what follows.
+
+* RUNNING AS UNPRIVILEGED USER WITHOUT COPYING /usr/share/redmine
+ Why : redmine package upgrades will benefit to all redmine instances.
+ Besides support for X_DEBIAN_SITEID, several environment variables are available :
+ RAILS_ETC (where database.yml, email.yml are supposed to be)
+ RAILS_LOG (the log files)
+ RAILS_VAR (contains the files/ directory)
+ RAILS_CACHE (cached data)
+ and, of course, RAILS_ENV
+ That way, one can install redmine as a user foo :
+ - first create some directories in e.g. /home/foo/redmine : config, files, tmp, log
+ - in a terminal, declare those environment variables :
+ mydir=/home/dev/test/redmine
+ export RAILS_ETC=$mydir/config
+ export RAILS_LOG=$mydir/log
+ export RAILS_VAR=$mydir
+ export RAILS_CACHE=$mydir/tmp
+ export RAILS_ENV=production
+ export X_DEBIAN_SITEID=myinstance
+ - copy /usr/share/redmine/templates/database.yml.template to $mydir/config/database.yml
+ and adapt it to your needs; for a quick setup it's easier to use the sqlite template,
+ located in the same dir.
+ - link /usr/share/redmine/db to $mydir/db :
+ ln -s /usr/share/redmine/db $mydir/db
+ - then "install" redmine, note that db:migrate can't dump to /usr/share/redmine/db/schema.rb,
+ but that won't stop redmine from working :
+ rake -f /usr/share/redmine/Rakefile generate_session_store
+ rake -f /usr/share/redmine/Rakefile db:migrate
+ rake -f /usr/share/redmine/Rakefile redmine:load_default_data
+ rake -f /usr/share/redmine/Rakefile db:migrate_plugins
+ - Run redmine using e.g. webrick and point your browser to localhost:3000
+ ruby /usr/share/redmine/script/server webrick -e production
+
* MANUAL EMAIL CONFIGURATION
Email settings are not automatically configured, for a quick setup, copy
/usr/share/doc/redmine/examples/email.yml
to
-/etc/redmine/<instance-identifier>/email.yml
+/etc/redmine/<instancename>/email.yml
+Then change permissions and owner :
+chmod 640 /etc/redmine/<instancename>/email.yml
+chown root:www-data /etc/redmine/<instancename>/email.yml
then restart redmine and check if it's working by sending a test email in
Administration panel -> Settings -> Email notifications -> Send a test email
or refer to the Redmine Guide.
Modified: trunk/redmine/debian/README.source
===================================================================
--- trunk/redmine/debian/README.source 2010-01-09 23:51:17 UTC (rev 4519)
+++ trunk/redmine/debian/README.source 2010-01-10 02:38:43 UTC (rev 4520)
@@ -1,7 +1,3 @@
-The targeted redmine version is 0.9, which is not released upstream yet.
-When it IS released, just use the watch file with "uscan",
-NOT what follows.
-
Notes from a discussion with upstream author:
Redmine 0.8.7 targets rails 2.1.2
Redmine 0.9 targets rails 2.3
@@ -12,16 +8,12 @@
Please note the diff from the pristine source contains only the debian/ folder.
-Updating the package with redmine SVN TRUNK at revision xxxx :
- * find the svn revision # that fits (not always latest) on
- http://www.redmine.org/projects/redmine/repository
- * in debian/.. update changelog with "dch -i" and define new version 0.9.0~svnxxxx-1 for your latest change
+Updating the package with redmine 0.9-stable branch:
* to get a "pristine" svn tar package :
./debian/rules get-orig-source
- * at this point uupdate won't help, so just extract the tar package and copy debian/ in it.
Then build the package :
- cd redmine-0.9.0~svnxxxx/
+ cd redmine-0.9.x/
debuild
@@ -33,7 +25,7 @@
Install missing gems (e.g. thoughtbot-shoulda, nofxx-object_daddy) using gem install xxx
To run tests with repositories, they must be uncompressed and put in the right place.
-4. These are rails 2.2 failures. It is not always clear wether the fix should be backported from rails 2.3,
+4. These are rails 2.2 failures. It is not clear (to me) wether the fix should be backported from rails 2.3,
or the failure simply ignored since they could be considered minor failures.
1) Failure:
test_login_and_logout_should_clear_session(AccountTest)
Modified: trunk/redmine/debian/TODO
===================================================================
--- trunk/redmine/debian/TODO 2010-01-09 23:51:17 UTC (rev 4519)
+++ trunk/redmine/debian/TODO 2010-01-10 02:38:43 UTC (rev 4520)
@@ -1,17 +1,8 @@
Current work to do :
-- session secret must be different for each instance ? That would imply
-much more : to give a distinct config/initializers/ dir for each instance.
-Besides, is it really useful ?
-- besides mendatory redmine "vendor/plugins", pave the way to package
-potentially interesting third-party plugins, see redmine web site for this.
-- rake locales:update ?
-- make it easy to run rake test suite.
- fix script/dbconsole (also a rails issue, accepted by rails maintainer, see #552615) so it can be called with :
sudo -u www-data ./script/dbconsole -p -y "/etc/redmine/default/database.yml" production
-
-For upcoming 0.9.0 release :
-- check watch file is working
-- remove version ~svnXXXX-Y for package version
-- in debian/rules, get rid of variables that use the version number in
-changelog, and add a warning for those who call get-orig-source target,
-since watch file will do the job.
+- login then logout does not clear session (this is rails 2.2 failure)
+- REST web service partially working, e.g.
+get /news.json with a valid HTTP authentication does not login as the user.
+- rake db:migrate actually calls db:dump, which tries to write to RAILS_ROOT/db/schema.rb
+This is a problem when run as unprivileged user (see README.Debian to reproduce).
Modified: trunk/redmine/debian/changelog
===================================================================
--- trunk/redmine/debian/changelog 2010-01-09 23:51:17 UTC (rev 4519)
+++ trunk/redmine/debian/changelog 2010-01-10 02:38:43 UTC (rev 4520)
@@ -1,15 +1,17 @@
-redmine (0.9.0~svn3280-1) UNRELEASED; urgency=low
+redmine (0.9.0-1) unstable; urgency=low
- * Upstream update.
+ * Release Candidate. Dropping svn version numbers.
* Stop using deprecated dbfile param in database.yml.
+ * Use session.yml to store secret session key.
+ * Supports and documents running as unprivileged user. (Closes: #564086)
+ * Split debian/patches.
* Fix typo in po templates. (Closes: #553376)
* Adds pt, de, sv, ru, es, ja translations.
(Closes: #553375, #551002, #552736, #554351, #560999, #555693)
- * session_store.rb owned by nobody. (Closes: #564086)
* Fixes CVE-2009-4459 : uses the title tag before defining
the character encoding in a meta tag. (Closes: #563940)
- -- Jérémy Lal <kapouer at melix.org> Sun, 01 Nov 2009 21:39:51 +0100
+ -- Jérémy Lal <kapouer at melix.org> Sun, 10 Jan 2010 03:34:37 +0100
redmine (0.9.0~svn2907-1) unstable; urgency=low
Added: trunk/redmine/debian/patches/0001-Revert-this-default_scope-rails-2.3-usage.patch
===================================================================
--- trunk/redmine/debian/patches/0001-Revert-this-default_scope-rails-2.3-usage.patch (rev 0)
+++ trunk/redmine/debian/patches/0001-Revert-this-default_scope-rails-2.3-usage.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -0,0 +1,33 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sun, 22 Nov 2009 23:29:40 +0100
+Subject: [PATCH] Revert this default_scope rails 2.3 usage.
+
+---
+ app/models/enumeration.rb | 6 ++----
+ 1 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb
+index 3b7a434..947e7b7 100644
+--- a/app/models/enumeration.rb
++++ b/app/models/enumeration.rb
+@@ -16,8 +16,6 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ class Enumeration < ActiveRecord::Base
+- default_scope :order => "#{Enumeration.table_name}.position ASC"
+-
+ belongs_to :project
+
+ acts_as_list :scope => 'type = \'#{type}\''
+@@ -30,8 +28,8 @@ class Enumeration < ActiveRecord::Base
+ validates_uniqueness_of :name, :scope => [:type, :project_id]
+ validates_length_of :name, :maximum => 30
+
+- named_scope :shared, :conditions => { :project_id => nil }
+- named_scope :active, :conditions => { :active => true }
++ named_scope :shared, :conditions => { :project_id => nil }, :order => "#{Enumeration.table_name}.position ASC"
++ named_scope :active, :conditions => { :active => true }, :order => "#{Enumeration.table_name}.position ASC"
+
+ def self.default
+ # Creates a fake default scope so Enumeration.default will check
+--
Added: trunk/redmine/debian/patches/0002-Revert-rails-2.3-changes-in-mailer.patch
===================================================================
--- trunk/redmine/debian/patches/0002-Revert-rails-2.3-changes-in-mailer.patch (rev 0)
+++ trunk/redmine/debian/patches/0002-Revert-rails-2.3-changes-in-mailer.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -0,0 +1,183 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Mon, 23 Nov 2009 00:32:38 +0100
+Subject: [PATCH] Revert rails 2.3 changes in mailer.
+
+---
+ app/models/mailer.rb | 49 ++++++++++++++++++-------------------------------
+ 1 files changed, 18 insertions(+), 31 deletions(-)
+
+diff --git a/app/models/mailer.rb b/app/models/mailer.rb
+index dfd2737..2f6a990 100644
+--- a/app/models/mailer.rb
++++ b/app/models/mailer.rb
+@@ -16,7 +16,6 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ class Mailer < ActionMailer::Base
+- layout 'mailer'
+ helper :application
+ helper :issues
+ helper :custom_fields
+@@ -46,7 +45,6 @@ class Mailer < ActionMailer::Base
+ subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
+ body :issue => issue,
+ :issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
+- render_multipart('issue_add', body)
+ end
+
+ # Builds a tmail object used to email recipients of the edited issue.
+@@ -73,8 +71,6 @@ class Mailer < ActionMailer::Base
+ body :issue => issue,
+ :journal => journal,
+ :issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
+-
+- render_multipart('issue_edit', body)
+ end
+
+ def reminder(user, issues, days)
+@@ -84,7 +80,6 @@ class Mailer < ActionMailer::Base
+ body :issues => issues,
+ :days => days,
+ :issues_url => url_for(:controller => 'issues', :action => 'index', :set_filter => 1, :assigned_to_id => user.id, :sort_key => 'due_date', :sort_order => 'asc')
+- render_multipart('reminder', body)
+ end
+
+ # Builds a tmail object used to email users belonging to the added document's project.
+@@ -98,7 +93,6 @@ class Mailer < ActionMailer::Base
+ subject "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
+ body :document => document,
+ :document_url => url_for(:controller => 'documents', :action => 'show', :id => document)
+- render_multipart('document_added', body)
+ end
+
+ # Builds a tmail object used to email recipients of a project when an attachements are added.
+@@ -129,7 +123,6 @@ class Mailer < ActionMailer::Base
+ body :attachments => attachments,
+ :added_to => added_to,
+ :added_to_url => added_to_url
+- render_multipart('attachments_added', body)
+ end
+
+ # Builds a tmail object used to email recipients of a news' project when a news item is added.
+@@ -144,7 +137,6 @@ class Mailer < ActionMailer::Base
+ subject "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
+ body :news => news,
+ :news_url => url_for(:controller => 'news', :action => 'show', :id => news)
+- render_multipart('news_added', body)
+ end
+
+ # Builds a tmail object used to email the recipients of the specified message that was posted.
+@@ -162,7 +154,6 @@ class Mailer < ActionMailer::Base
+ subject "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}"
+ body :message => message,
+ :message_url => url_for(:controller => 'messages', :action => 'show', :board_id => message.board_id, :id => message.root)
+- render_multipart('message_posted', body)
+ end
+
+ # Builds a tmail object used to email the recipients of a project of the specified wiki content was added.
+@@ -179,7 +170,6 @@ class Mailer < ActionMailer::Base
+ subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :page => wiki_content.page.pretty_title)}"
+ body :wiki_content => wiki_content,
+ :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :page => wiki_content.page.title)
+- render_multipart('wiki_content_added', body)
+ end
+
+ # Builds a tmail object used to email the recipients of a project of the specified wiki content was updated.
+@@ -197,7 +187,6 @@ class Mailer < ActionMailer::Base
+ body :wiki_content => wiki_content,
+ :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :page => wiki_content.page.title),
+ :wiki_diff_url => url_for(:controller => 'wiki', :action => 'diff', :id => wiki_content.project, :page => wiki_content.page.title, :version => wiki_content.version)
+- render_multipart('wiki_content_updated', body)
+ end
+
+ # Builds a tmail object used to email the specified user their account information.
+@@ -212,7 +201,6 @@ class Mailer < ActionMailer::Base
+ body :user => user,
+ :password => password,
+ :login_url => url_for(:controller => 'account', :action => 'login')
+- render_multipart('account_information', body)
+ end
+
+ # Builds a tmail object used to email all active administrators of an account activation request.
+@@ -226,7 +214,6 @@ class Mailer < ActionMailer::Base
+ subject l(:mail_subject_account_activation_request, Setting.app_title)
+ body :user => user,
+ :url => url_for(:controller => 'users', :action => 'index', :status => User::STATUS_REGISTERED, :sort_key => 'created_on', :sort_order => 'desc')
+- render_multipart('account_activation_request', body)
+ end
+
+ # Builds a tmail object used to email the specified user that their account was activated by an administrator.
+@@ -240,7 +227,6 @@ class Mailer < ActionMailer::Base
+ subject l(:mail_subject_register, Setting.app_title)
+ body :user => user,
+ :login_url => url_for(:controller => 'account', :action => 'login')
+- render_multipart('account_activated', body)
+ end
+
+ def lost_password(token)
+@@ -249,7 +235,6 @@ class Mailer < ActionMailer::Base
+ subject l(:mail_subject_lost_password, Setting.app_title)
+ body :token => token,
+ :url => url_for(:controller => 'account', :action => 'lost_password', :token => token.value)
+- render_multipart('lost_password', body)
+ end
+
+ def register(token)
+@@ -258,7 +243,6 @@ class Mailer < ActionMailer::Base
+ subject l(:mail_subject_register, Setting.app_title)
+ body :token => token,
+ :url => url_for(:controller => 'account', :action => 'activate', :token => token.value)
+- render_multipart('register', body)
+ end
+
+ def test(user)
+@@ -266,7 +250,6 @@ class Mailer < ActionMailer::Base
+ recipients user.mail
+ subject 'Redmine test'
+ body :url => url_for(:controller => 'welcome')
+- render_multipart('test', body)
+ end
+
+ # Overrides default deliver! method to prevent from sending an email
+@@ -347,22 +330,26 @@ class Mailer < ActionMailer::Base
+ super
+ end
+
+- # Rails 2.3 has problems rendering implicit multipart messages with
+- # layouts so this method will wrap an multipart messages with
+- # explicit parts.
+- #
+- # https://rails.lighthouseapp.com/projects/8994/tickets/2338-actionmailer-mailer-views-and-content-type
+- # https://rails.lighthouseapp.com/projects/8994/tickets/1799-actionmailer-doesnt-set-template_format-when-rendering-layouts
+-
+- def render_multipart(method_name, body)
++ # Renders a message with the corresponding layout
++ def render_message(method_name, body)
++ layout = method_name.to_s.match(%r{text\.html\.(rhtml|rxml)}) ? 'layout.text.html.rhtml' : 'layout.text.plain.rhtml'
++ body[:content_for_layout] = render(:file => method_name, :body => body)
++ ActionView::Base.new(template_root, body, self).render(:file => "mailer/#{layout}", :use_full_path => true)
++ end
++
++ # for the case of plain text only
++ def body(*params)
++ value = super(*params)
+ if Setting.plain_text_mail?
+- content_type "text/plain"
+- body render(:file => "#{method_name}.text.plain.rhtml", :body => body, :layout => 'mailer.text.plain.erb')
+- else
+- content_type "multipart/alternative"
+- part :content_type => "text/plain", :body => render(:file => "#{method_name}.text.plain.rhtml", :body => body, :layout => 'mailer.text.plain.erb')
+- part :content_type => "text/html", :body => render_message("#{method_name}.text.html.rhtml", body)
++ templates = Dir.glob("#{template_path}/#{@template}.text.plain.{rhtml,erb}")
++ unless String === @body or templates.empty?
++ template = File.basename(templates.first)
++ @body[:content_for_layout] = render(:file => template, :body => @body)
++ @body = ActionView::Base.new(template_root, @body, self).render(:file => "mailer/layout.text.plain.rhtml", :use_full_path => true)
++ return @body
++ end
+ end
++ return value
+ end
+
+ # Makes partial rendering work with Rails 1.2 (retro-compatibility)
+--
Added: trunk/redmine/debian/patches/0003-Depends-on-rails-2.2.3.patch
===================================================================
--- trunk/redmine/debian/patches/0003-Depends-on-rails-2.2.3.patch (rev 0)
+++ trunk/redmine/debian/patches/0003-Depends-on-rails-2.2.3.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -0,0 +1,42 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Mon, 23 Nov 2009 00:44:09 +0100
+Subject: [PATCH] Depends on rails 2.2.3
+
+---
+ config/environment.rb | 2 +-
+ vendor/plugins/engines/boot.rb | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/config/environment.rb b/config/environment.rb
+index 97fc54a..1f7d23e 100644
+--- a/config/environment.rb
++++ b/config/environment.rb
+@@ -5,7 +5,7 @@
+ # ENV['RAILS_ENV'] ||= 'production'
+
+ # Specifies gem version of Rails to use when vendor/rails is not present
+-RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
++RAILS_GEM_VERSION = '2.2.3' unless defined? RAILS_GEM_VERSION
+
+ # Bootstrap the Rails environment, frameworks, and default configuration
+ require File.join(File.dirname(__FILE__), 'boot')
+diff --git a/vendor/plugins/engines/boot.rb b/vendor/plugins/engines/boot.rb
+index 7dd90d1..c153353 100644
+--- a/vendor/plugins/engines/boot.rb
++++ b/vendor/plugins/engines/boot.rb
+@@ -1,6 +1,6 @@
+ begin
+ require 'rails/version'
+- unless Rails::VERSION::MAJOR >= 2 && Rails::VERSION::MINOR >= 3 && Rails::VERSION::TINY >= 2
++ unless Rails::VERSION::MAJOR >= 2 && Rails::VERSION::MINOR >= 2 && Rails::VERSION::TINY >= 3
+ raise "This version of the engines plugin requires Rails 2.3.2 or later!"
+ end
+ end
+@@ -14,4 +14,4 @@ require File.join(File.dirname(__FILE__), 'lib/engines')
+ :default_plugin_loader => Engines::Plugin::Loader,
+ :default_plugins => [:engines, :all] }.each do |name, default|
+ Rails::Configuration.send(:define_method, name) { default }
+-end
+\ No newline at end of file
++end
+--
Added: 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 (rev 0)
+++ trunk/redmine/debian/patches/0004-Monkey-patches-for-group-support-taken-from-rails-2..patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -0,0 +1,62 @@
+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 | 46 +++++++++++++++++++++++++++++++++++
+ 1 files changed, 46 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..e5761ec
+--- /dev/null
++++ b/config/initializers/action_group.rb
+@@ -0,0 +1,46 @@
++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'
++ class FormOptionsHelperTest < 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
++
++
+--
Added: trunk/redmine/debian/patches/0005-Converts-OrderedHash-to-Hash-using-to_hash-since-in-.patch
===================================================================
--- trunk/redmine/debian/patches/0005-Converts-OrderedHash-to-Hash-using-to_hash-since-in-.patch (rev 0)
+++ trunk/redmine/debian/patches/0005-Converts-OrderedHash-to-Hash-using-to_hash-since-in-.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -0,0 +1,22 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer at melix.org>
+Date: Sat, 12 Dec 2009 18:04:35 +0100
+Subject: [PATCH] Converts OrderedHash to Hash using 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
+
+--
Added: trunk/redmine/debian/patches/0006-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch
===================================================================
--- trunk/redmine/debian/patches/0006-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch (rev 0)
+++ trunk/redmine/debian/patches/0006-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -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)
+--
Added: trunk/redmine/debian/patches/0007-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch
===================================================================
--- trunk/redmine/debian/patches/0007-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch (rev 0)
+++ trunk/redmine/debian/patches/0007-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -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"
+--
Added: trunk/redmine/debian/patches/0008-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch
===================================================================
--- trunk/redmine/debian/patches/0008-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch (rev 0)
+++ trunk/redmine/debian/patches/0008-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -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
+--
Added: trunk/redmine/debian/patches/0009-Revert-this-rails-2.3-plugin.patch
===================================================================
--- trunk/redmine/debian/patches/0009-Revert-this-rails-2.3-plugin.patch (rev 0)
+++ trunk/redmine/debian/patches/0009-Revert-this-rails-2.3-plugin.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -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
+-
+--
Added: trunk/redmine/debian/patches/0010-Wrong-path-for-interpreter.patch
===================================================================
--- trunk/redmine/debian/patches/0010-Wrong-path-for-interpreter.patch (rev 0)
+++ trunk/redmine/debian/patches/0010-Wrong-path-for-interpreter.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -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/0011-Allows-environment-variables-to-setup-debian-paths.patch (from rev 4499, trunk/redmine/debian/patches/01_paths.patch)
===================================================================
--- trunk/redmine/debian/patches/0011-Allows-environment-variables-to-setup-debian-paths.patch (rev 0)
+++ trunk/redmine/debian/patches/0011-Allows-environment-variables-to-setup-debian-paths.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -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
+--
Added: trunk/redmine/debian/patches/0012-Move-session-configuration-to-YML-file-next-to-datab.patch
===================================================================
--- trunk/redmine/debian/patches/0012-Move-session-configuration-to-YML-file-next-to-datab.patch (rev 0)
+++ trunk/redmine/debian/patches/0012-Move-session-configuration-to-YML-file-next-to-datab.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -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']
+--
Deleted: trunk/redmine/debian/patches/01_paths.patch
===================================================================
--- trunk/redmine/debian/patches/01_paths.patch 2010-01-09 23:51:17 UTC (rev 4519)
+++ trunk/redmine/debian/patches/01_paths.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -1,86 +0,0 @@
-diff -Nur redmine-0.9.0~svn3084/app/models/attachment.rb redmine-0.9.0~svn3084.new/app/models/attachment.rb
---- redmine-0.9.0~svn3084/app/models/attachment.rb 2009-04-25 11:31:36.000000000 +0200
-+++ redmine-0.9.0~svn3084.new/app/models/attachment.rb 2009-11-23 20:50:40.130710460 +0100
-@@ -43,7 +43,7 @@
- "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 -Nur redmine-0.9.0~svn3084/config/environment.rb redmine-0.9.0~svn3084.new/config/environment.rb
---- redmine-0.9.0~svn3084/config/environment.rb 2009-11-23 20:51:10.490601461 +0100
-+++ redmine-0.9.0~svn3084.new/config/environment.rb 2009-11-23 20:50:40.134570533 +0100
-@@ -2,7 +2,14 @@
-
- # 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
-+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 +37,18 @@
- # (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 -Nur redmine-0.9.0~svn3084/config/initializers/10-patches.rb redmine-0.9.0~svn3084.new/config/initializers/10-patches.rb
---- redmine-0.9.0~svn3084/config/initializers/10-patches.rb 2009-11-07 10:50:16.000000000 +0100
-+++ redmine-0.9.0~svn3084.new/config/initializers/10-patches.rb 2009-11-23 20:50:40.134570533 +0100
-@@ -78,3 +78,6 @@
- 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 -Nur redmine-0.9.0~svn3084/config/initializers/40-email.rb redmine-0.9.0~svn3084.new/config/initializers/40-email.rb
---- redmine-0.9.0~svn3084/config/initializers/40-email.rb 2008-07-04 20:55:45.000000000 +0200
-+++ redmine-0.9.0~svn3084.new/config/initializers/40-email.rb 2009-11-23 20:50:40.134570533 +0100
-@@ -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 -Nur redmine-0.9.0~svn3084/public/dispatch.fcgi.example redmine-0.9.0~svn3084.new/public/dispatch.fcgi.example
---- redmine-0.9.0~svn3084/public/dispatch.fcgi.example 2008-11-11 14:54:10.000000000 +0100
-+++ redmine-0.9.0~svn3084.new/public/dispatch.fcgi.example 2009-11-23 20:50:40.134570533 +0100
-@@ -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/02_session_path.patch
===================================================================
--- trunk/redmine/debian/patches/02_session_path.patch 2010-01-09 23:51:17 UTC (rev 4519)
+++ trunk/redmine/debian/patches/02_session_path.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -1,14 +0,0 @@
-By default, _redmine_session cookie path is /
-This patch sets the path to ENV['RAILS_RELATIVE_URL_ROOT'], so that
-multiple instances of redmine have distinct session cookies in any case.
-diff -Nur redmine-0.9.0~svn2903/lib/tasks/initializers.rake redmine-0.9.0~svn2903.new/lib/tasks/initializers.rake
---- redmine-0.9.0~svn2903/lib/tasks/initializers.rake 2009-02-21 12:04:50.000000000 +0100
-+++ redmine-0.9.0~svn2903.new/lib/tasks/initializers.rake 2009-10-04 23:40:41.963650176 +0200
-@@ -17,6 +17,7 @@
- # you'll be exposed to dictionary attacks.
- ActionController::Base.session = {
- :session_key => '_redmine_session',
-+ :session_path => ENV['RAILS_RELATIVE_URL_ROOT'] ? ENV['RAILS_RELATIVE_URL_ROOT'] : '/',
- :secret => '#{secret}'
- }
- EOF
Deleted: trunk/redmine/debian/patches/revert_rails_2.3.patch
===================================================================
--- trunk/redmine/debian/patches/revert_rails_2.3.patch 2010-01-09 23:51:17 UTC (rev 4519)
+++ trunk/redmine/debian/patches/revert_rails_2.3.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -1,466 +0,0 @@
-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
-diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb
-index 3b7a434..947e7b7 100644
---- a/app/models/enumeration.rb
-+++ b/app/models/enumeration.rb
-@@ -16,8 +16,6 @@
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- class Enumeration < ActiveRecord::Base
-- default_scope :order => "#{Enumeration.table_name}.position ASC"
--
- belongs_to :project
-
- acts_as_list :scope => 'type = \'#{type}\''
-@@ -30,8 +28,8 @@ class Enumeration < ActiveRecord::Base
- validates_uniqueness_of :name, :scope => [:type, :project_id]
- validates_length_of :name, :maximum => 30
-
-- named_scope :shared, :conditions => { :project_id => nil }
-- named_scope :active, :conditions => { :active => true }
-+ named_scope :shared, :conditions => { :project_id => nil }, :order => "#{Enumeration.table_name}.position ASC"
-+ named_scope :active, :conditions => { :active => true }, :order => "#{Enumeration.table_name}.position ASC"
-
- def self.default
- # Creates a fake default scope so Enumeration.default will check
-diff --git a/app/models/issue.rb b/app/models/issue.rb
-index b9e0461..ed45efb 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
-- self.attributes_without_tracker_first = new_attributes, *args
-+ self.attributes_without_tracker_first = new_attributes.to_hash, *args
- end
- alias_method_chain :attributes=, :tracker_first
-
-diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
-index ac05847..d69e20a 100644
---- a/app/models/mail_handler.rb
-+++ b/app/models/mail_handler.rb
-@@ -89,7 +89,7 @@ class MailHandler < ActionMailer::Base
- if headers.detect {|h| h.to_s =~ MESSAGE_ID_RE}
- klass, object_id = $1, $2.to_i
- method_name = "receive_#{klass}_reply"
-- if self.class.private_instance_methods.collect(&:to_s).include?(method_name)
-+ if self.class.private_instance_methods.include?(method_name)
- send method_name, object_id
- else
- # ignoring it
-diff --git a/app/models/mailer.rb b/app/models/mailer.rb
-index dfd2737..2f6a990 100644
---- a/app/models/mailer.rb
-+++ b/app/models/mailer.rb
-@@ -16,7 +16,6 @@
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- class Mailer < ActionMailer::Base
-- layout 'mailer'
- helper :application
- helper :issues
- helper :custom_fields
-@@ -46,7 +45,6 @@ class Mailer < ActionMailer::Base
- subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
- body :issue => issue,
- :issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
-- render_multipart('issue_add', body)
- end
-
- # Builds a tmail object used to email recipients of the edited issue.
-@@ -73,8 +71,6 @@ class Mailer < ActionMailer::Base
- body :issue => issue,
- :journal => journal,
- :issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
--
-- render_multipart('issue_edit', body)
- end
-
- def reminder(user, issues, days)
-@@ -84,7 +80,6 @@ class Mailer < ActionMailer::Base
- body :issues => issues,
- :days => days,
- :issues_url => url_for(:controller => 'issues', :action => 'index', :set_filter => 1, :assigned_to_id => user.id, :sort_key => 'due_date', :sort_order => 'asc')
-- render_multipart('reminder', body)
- end
-
- # Builds a tmail object used to email users belonging to the added document's project.
-@@ -98,7 +93,6 @@ class Mailer < ActionMailer::Base
- subject "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
- body :document => document,
- :document_url => url_for(:controller => 'documents', :action => 'show', :id => document)
-- render_multipart('document_added', body)
- end
-
- # Builds a tmail object used to email recipients of a project when an attachements are added.
-@@ -129,7 +123,6 @@ class Mailer < ActionMailer::Base
- body :attachments => attachments,
- :added_to => added_to,
- :added_to_url => added_to_url
-- render_multipart('attachments_added', body)
- end
-
- # Builds a tmail object used to email recipients of a news' project when a news item is added.
-@@ -144,7 +137,6 @@ class Mailer < ActionMailer::Base
- subject "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
- body :news => news,
- :news_url => url_for(:controller => 'news', :action => 'show', :id => news)
-- render_multipart('news_added', body)
- end
-
- # Builds a tmail object used to email the recipients of the specified message that was posted.
-@@ -162,7 +154,6 @@ class Mailer < ActionMailer::Base
- subject "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}"
- body :message => message,
- :message_url => url_for(:controller => 'messages', :action => 'show', :board_id => message.board_id, :id => message.root)
-- render_multipart('message_posted', body)
- end
-
- # Builds a tmail object used to email the recipients of a project of the specified wiki content was added.
-@@ -179,7 +170,6 @@ class Mailer < ActionMailer::Base
- subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :page => wiki_content.page.pretty_title)}"
- body :wiki_content => wiki_content,
- :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :page => wiki_content.page.title)
-- render_multipart('wiki_content_added', body)
- end
-
- # Builds a tmail object used to email the recipients of a project of the specified wiki content was updated.
-@@ -197,7 +187,6 @@ class Mailer < ActionMailer::Base
- body :wiki_content => wiki_content,
- :wiki_content_url => url_for(:controller => 'wiki', :action => 'index', :id => wiki_content.project, :page => wiki_content.page.title),
- :wiki_diff_url => url_for(:controller => 'wiki', :action => 'diff', :id => wiki_content.project, :page => wiki_content.page.title, :version => wiki_content.version)
-- render_multipart('wiki_content_updated', body)
- end
-
- # Builds a tmail object used to email the specified user their account information.
-@@ -212,7 +201,6 @@ class Mailer < ActionMailer::Base
- body :user => user,
- :password => password,
- :login_url => url_for(:controller => 'account', :action => 'login')
-- render_multipart('account_information', body)
- end
-
- # Builds a tmail object used to email all active administrators of an account activation request.
-@@ -226,7 +214,6 @@ class Mailer < ActionMailer::Base
- subject l(:mail_subject_account_activation_request, Setting.app_title)
- body :user => user,
- :url => url_for(:controller => 'users', :action => 'index', :status => User::STATUS_REGISTERED, :sort_key => 'created_on', :sort_order => 'desc')
-- render_multipart('account_activation_request', body)
- end
-
- # Builds a tmail object used to email the specified user that their account was activated by an administrator.
-@@ -240,7 +227,6 @@ class Mailer < ActionMailer::Base
- subject l(:mail_subject_register, Setting.app_title)
- body :user => user,
- :login_url => url_for(:controller => 'account', :action => 'login')
-- render_multipart('account_activated', body)
- end
-
- def lost_password(token)
-@@ -249,7 +235,6 @@ class Mailer < ActionMailer::Base
- subject l(:mail_subject_lost_password, Setting.app_title)
- body :token => token,
- :url => url_for(:controller => 'account', :action => 'lost_password', :token => token.value)
-- render_multipart('lost_password', body)
- end
-
- def register(token)
-@@ -258,7 +243,6 @@ class Mailer < ActionMailer::Base
- subject l(:mail_subject_register, Setting.app_title)
- body :token => token,
- :url => url_for(:controller => 'account', :action => 'activate', :token => token.value)
-- render_multipart('register', body)
- end
-
- def test(user)
-@@ -266,7 +250,6 @@ class Mailer < ActionMailer::Base
- recipients user.mail
- subject 'Redmine test'
- body :url => url_for(:controller => 'welcome')
-- render_multipart('test', body)
- end
-
- # Overrides default deliver! method to prevent from sending an email
-@@ -347,22 +330,26 @@ class Mailer < ActionMailer::Base
- super
- end
-
-- # Rails 2.3 has problems rendering implicit multipart messages with
-- # layouts so this method will wrap an multipart messages with
-- # explicit parts.
-- #
-- # https://rails.lighthouseapp.com/projects/8994/tickets/2338-actionmailer-mailer-views-and-content-type
-- # https://rails.lighthouseapp.com/projects/8994/tickets/1799-actionmailer-doesnt-set-template_format-when-rendering-layouts
--
-- def render_multipart(method_name, body)
-+ # Renders a message with the corresponding layout
-+ def render_message(method_name, body)
-+ layout = method_name.to_s.match(%r{text\.html\.(rhtml|rxml)}) ? 'layout.text.html.rhtml' : 'layout.text.plain.rhtml'
-+ body[:content_for_layout] = render(:file => method_name, :body => body)
-+ ActionView::Base.new(template_root, body, self).render(:file => "mailer/#{layout}", :use_full_path => true)
-+ end
-+
-+ # for the case of plain text only
-+ def body(*params)
-+ value = super(*params)
- if Setting.plain_text_mail?
-- content_type "text/plain"
-- body render(:file => "#{method_name}.text.plain.rhtml", :body => body, :layout => 'mailer.text.plain.erb')
-- else
-- content_type "multipart/alternative"
-- part :content_type => "text/plain", :body => render(:file => "#{method_name}.text.plain.rhtml", :body => body, :layout => 'mailer.text.plain.erb')
-- part :content_type => "text/html", :body => render_message("#{method_name}.text.html.rhtml", body)
-+ templates = Dir.glob("#{template_path}/#{@template}.text.plain.{rhtml,erb}")
-+ unless String === @body or templates.empty?
-+ template = File.basename(templates.first)
-+ @body[:content_for_layout] = render(:file => template, :body => @body)
-+ @body = ActionView::Base.new(template_root, @body, self).render(:file => "mailer/layout.text.plain.rhtml", :use_full_path => true)
-+ return @body
-+ end
- end
-+ return value
- end
-
- # Makes partial rendering work with Rails 1.2 (retro-compatibility)
-diff --git a/app/models/query.rb b/app/models/query.rb
-index afbb687..9b27e4a 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)
-diff --git a/config/environment.rb b/config/environment.rb
-index 97fc54a..1f7d23e 100644
---- a/config/environment.rb
-+++ b/config/environment.rb
-@@ -5,7 +5,7 @@
- # ENV['RAILS_ENV'] ||= 'production'
-
- # Specifies gem version of Rails to use when vendor/rails is not present
--RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
-+RAILS_GEM_VERSION = '2.2.3' unless defined? RAILS_GEM_VERSION
-
- # Bootstrap the Rails environment, frameworks, and default configuration
- require File.join(File.dirname(__FILE__), 'boot')
-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"
-diff --git a/config/initializers/action_group.rb b/config/initializers/action_group.rb
-new file mode 100644
-index 0000000..e5761ec
---- /dev/null
-+++ b/config/initializers/action_group.rb
-@@ -0,0 +1,46 @@
-+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'
-+ class FormOptionsHelperTest < 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
-+
-+
-diff --git a/lib/SVG/Graph/Graph.rb b/lib/SVG/Graph/Graph.rb
-index 497bb7c..c188ae5 100644
---- a/lib/SVG/Graph/Graph.rb
-+++ b/lib/SVG/Graph/Graph.rb
-@@ -150,7 +150,7 @@ module SVG
- :add_popups =>false,
- })
-
-- set_defaults if respond_to? :set_defaults
-+ set_defaults if methods.include? "set_defaults"
-
- init_with config
- end
-@@ -195,7 +195,7 @@ module SVG
- def burn
- raise "No data available" unless @data.size > 0
-
-- calculations if respond_to? :calculations
-+ calculations if methods.include? 'calculations'
-
- start_svg
- calculate_graph_dimensions
-@@ -355,7 +355,7 @@ module SVG
- # by subclasses.
- def init_with config
- config.each { |key, value|
-- self.send((key.to_s+"=").to_sym, value ) if respond_to? key.to_sym
-+ self.send( key.to_s+"=", value ) if methods.include? key.to_s
- }
- end
-
-diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb
-index 79dd0b6..f18abad 100644
---- a/lib/redcloth3.rb
-+++ b/lib/redcloth3.rb
-@@ -577,7 +577,7 @@ class RedCloth3 < String
- end
- end
-
-- QUOTES_RE = /(^>+([^\n]*?)(\n|$))+/m
-+ QUOTES_RE = /(^>+([^\n]*?)\n?)+/m
- QUOTES_CONTENT_RE = /^([> ]+)(.*)$/m
-
- def block_textile_quotes( text )
-diff --git a/lib/redmine/unified_diff.rb b/lib/redmine/unified_diff.rb
-index 09fbfcf..43f033f 100644
---- a/lib/redmine/unified_diff.rb
-+++ b/lib/redmine/unified_diff.rb
-@@ -20,7 +20,6 @@ module Redmine
- class UnifiedDiff < Array
- def initialize(diff, options={})
- options.assert_valid_keys(:type, :max_lines)
-- diff = diff.split("\n") if diff.is_a?(String)
- diff_type = options[:type] || 'inline'
-
- lines = 0
-diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb
-index dfc6caf..0f6e4bf 100644
---- a/test/unit/mailer_test.rb
-+++ b/test/unit/mailer_test.rb
-@@ -141,7 +141,7 @@ class MailerTest < ActiveSupport::TestCase
- mail = ActionMailer::Base.deliveries.last
- assert_not_nil mail
- assert_equal Mailer.message_id_for(journal), mail.message_id
-- assert_equal Mailer.message_id_for(journal.issue), mail.references.first.to_s
-+ assert_equal Mailer.message_id_for(journal.issue), mail.references.to_s
- end
-
- def test_message_posted_message_id
-@@ -161,7 +161,7 @@ class MailerTest < ActiveSupport::TestCase
- mail = ActionMailer::Base.deliveries.last
- assert_not_nil mail
- assert_equal Mailer.message_id_for(message), mail.message_id
-- assert_equal Mailer.message_id_for(message.parent), mail.references.first.to_s
-+ assert_equal Mailer.message_id_for(message.parent), mail.references.to_s
- end
-
- context("#issue_add") do
-diff --git a/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb b/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb
-index 6be3c5e..fb67341 100644
---- a/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb
-+++ b/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb
-@@ -166,7 +166,7 @@ module CollectiveIdea #:nodoc:
- # Don't rebuild a valid tree.
- return true if valid?
-
-- scope = lambda{|node|}
-+ scope = lambda{}
- if acts_as_nested_set_options[:scope]
- scope = lambda{|node|
- scope_column_names.inject(""){|str, column_name|
-diff --git a/vendor/plugins/engines/boot.rb b/vendor/plugins/engines/boot.rb
-index 7dd90d1..c153353 100644
---- a/vendor/plugins/engines/boot.rb
-+++ b/vendor/plugins/engines/boot.rb
-@@ -1,6 +1,6 @@
- begin
- require 'rails/version'
-- unless Rails::VERSION::MAJOR >= 2 && Rails::VERSION::MINOR >= 3 && Rails::VERSION::TINY >= 2
-+ unless Rails::VERSION::MAJOR >= 2 && Rails::VERSION::MINOR >= 2 && Rails::VERSION::TINY >= 3
- raise "This version of the engines plugin requires Rails 2.3.2 or later!"
- end
- end
-@@ -14,4 +14,4 @@ require File.join(File.dirname(__FILE__), 'lib/engines')
- :default_plugin_loader => Engines::Plugin::Loader,
- :default_plugins => [:engines, :all] }.each do |name, default|
- Rails::Configuration.send(:define_method, name) { default }
--end
-\ No newline at end of file
-+end
-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
--
Modified: trunk/redmine/debian/patches/series
===================================================================
--- trunk/redmine/debian/patches/series 2010-01-09 23:51:17 UTC (rev 4519)
+++ trunk/redmine/debian/patches/series 2010-01-10 02:38:43 UTC (rev 4520)
@@ -1,4 +1,12 @@
-wrong_path_for_interpreter.patch
-revert_rails_2.3.patch
-01_paths.patch
-02_session_path.patch
+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-Converts-OrderedHash-to-Hash-using-to_hash-since-in-.patch
+0006-Returns-a-hash-in-any-case-since-rails-2.2-could-ret.patch
+0007-No-need-to-declare-dependency-on-mocha.-It-s-there-b.patch
+0008-Rescue-TamperedWithCookie-because-rails-2.2-does-not.patch
+0009-Revert-this-rails-2.3-plugin.patch
+0010-Wrong-path-for-interpreter.patch
+0011-Allows-environment-variables-to-setup-debian-paths.patch
+0012-Move-session-configuration-to-YML-file-next-to-datab.patch
Deleted: trunk/redmine/debian/patches/wrong_path_for_interpreter.patch
===================================================================
--- trunk/redmine/debian/patches/wrong_path_for_interpreter.patch 2010-01-09 23:51:17 UTC (rev 4519)
+++ trunk/redmine/debian/patches/wrong_path_for_interpreter.patch 2010-01-10 02:38:43 UTC (rev 4520)
@@ -1,8 +0,0 @@
---- a/lib/faster_csv.rb 2009-11-04 14:22:26.000000000 +0100
-+++ b/lib/faster_csv.rb 2009-11-23 00:51:25.367654370 +0100
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/ruby -w
-+#!/usr/bin/ruby -w
-
- # = faster_csv.rb -- Faster CSV Reading and Writing
- #
Modified: trunk/redmine/debian/postinst
===================================================================
--- trunk/redmine/debian/postinst 2010-01-09 23:51:17 UTC (rev 4519)
+++ trunk/redmine/debian/postinst 2010-01-10 02:38:43 UTC (rev 4520)
@@ -81,11 +81,6 @@
mkdir tmp
fi
chown -fR www-data:www-data tmp
- # add secret key, set permissions
- rake -s config/initializers/session_store.rb RAILS_ENV=$fRailsEnv || true
- # let default config of passenger access it (passenger works as user nobody).
- chown -f nobody:www-data config/initializers/session_store.rb
- chmod 640 config/initializers/session_store.rb
cd $savedir
;;
@@ -200,6 +195,20 @@
chown -f www-data:www-data /var/run/redmine/sockets/${lInstance}
savedir="`pwd`"
cd /usr/share/redmine
+
+ # add secret key, set permissions, manage file with ucf
+ rake -s generate_session_store 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
+ ucf --debconf-ok ${fRailsEtc}/session.yml.new ${fRailsEtc}/session.yml
+ rm ${fRailsEtc}/session.yml.new
+ # move old session_store.rb
+ echo "A new secret session key has been generated in ${fRailsEtc}/session.yml"
+ if [ -f config/initializers/session_store.rb ]; then
+ mv config/initializers/session_store.rb config/initializers/session_store.rb.dpkg-old
+ echo "The old secret session key can be found in
+/usr/share/redmine/config/initializers/session_store.rb.dpkg-old"
+ fi
if [ $withdb -eq 1 ]; then
db_get redmine/instances/${lInstance}/default-language && DEFAULT_LANGUAGE="$RET"
# handle rake install
Modified: trunk/redmine/debian/postrm
===================================================================
--- trunk/redmine/debian/postrm 2010-01-09 23:51:17 UTC (rev 4519)
+++ trunk/redmine/debian/postrm 2010-01-10 02:38:43 UTC (rev 4520)
@@ -62,10 +62,12 @@
for lInstance in $gOldInstances; do
ucf --purge /etc/redmine/$lInstance/database.yml
ucf --purge /etc/redmine/$lInstance/email.yml
+ ucf --purge /etc/redmine/$lInstance/session.yml
done
for lInstance in $gInstances; do
ucf --purge /etc/redmine/$lInstance/database.yml
ucf --purge /etc/redmine/$lInstance/email.yml
+ ucf --purge /etc/redmine/$lInstance/session.yml
done
fi
More information about the Pkg-ruby-extras-commits
mailing list