[DRE-commits] [redmine] 13/15: adjust all patches to set RAILS_* unconditionally
Antonio Terceiro
terceiro at moszumanska.debian.org
Sat May 2 21:00:06 UTC 2015
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository redmine.
commit 971c350c4a78c79210cb5527f331909e1721ad98
Author: Antonio Terceiro <terceiro at debian.org>
Date: Sat May 2 12:19:59 2015 -0300
adjust all patches to set RAILS_* unconditionally
---
debian/changelog | 7 ++++---
debian/patches/2002_FHS_through_env_vars.patch | 8 ++++----
debian/patches/2009_FHS_thin_config.patch | 8 ++++----
debian/patches/gemfile-adjustments.patch | 2 +-
4 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 7d11c38..3a04626 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,9 +6,10 @@ redmine (3.0~20140825-6) unstable; urgency=medium
- debian/postinst: run rake under `bundle exec` to correctly handle
upgrades when the local admin installed non-packaged plugins (i.e.
~100% of them).
- - debian/patches/2003_externalize_session_config.patch: always set
- RAILS_ETC unconditionally from X_DEBIAN_SITEID because the load order
- under `bundle exec` seems to be a little different.
+ - 2003_externalize_session_config.patch, 2002_FHS_through_env_vars.patch,
+ gemfile-adjustments.patch: always set RAILS_ETC, RAILS_* unconditionally
+ from X_DEBIAN_SITEID because the load order under `bundle exec` seems to
+ be a little different.
- change Gemfile.lock handling:
+ symlink Gemfile.lock to /var/lib/redmine/Gemfile.lock
+ always update it at the beginning of debian/postinst
diff --git a/debian/patches/2002_FHS_through_env_vars.patch b/debian/patches/2002_FHS_through_env_vars.patch
index d2aeb7f..231e283 100644
--- a/debian/patches/2002_FHS_through_env_vars.patch
+++ b/debian/patches/2002_FHS_through_env_vars.patch
@@ -60,10 +60,10 @@ Last-Update: 2013-09-28
+# 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_TMP'] ||= "/var/cache/redmine/#{ENV['X_DEBIAN_SITEID']}"
++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_TMP'] = "/var/cache/redmine/#{ENV['X_DEBIAN_SITEID']}"
+
Bundler.require(*Rails.groups)
diff --git a/debian/patches/2009_FHS_thin_config.patch b/debian/patches/2009_FHS_thin_config.patch
index 1ad1d70..7f44a42 100644
--- a/debian/patches/2009_FHS_thin_config.patch
+++ b/debian/patches/2009_FHS_thin_config.patch
@@ -3,13 +3,13 @@ Description: FHS support for thin config
Forwarded: not-needed
Author: Jérémy Lal <kapouer at melix.org>
Last-Update: 2010-11-01
---- redmine.orig/config/application.rb
-+++ redmine/config/application.rb
+--- a/config/application.rb
++++ b/config/application.rb
@@ -7,6 +7,7 @@ Rails.env ||= ActiveSupport::StringInqui
# for debian package : setup proper environment variables and paths
# To run redmine as unprivileged user, see /usr/share/doc/redmine/README.Debian
+ObjectSpace.each_object(Thin::Runner){|x| ENV["X_DEBIAN_SITEID"] = x.options[:x_debian_siteid] if x.options[:x_debian_siteid]} if defined?(Thin)
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_ETC'] = "/etc/redmine/#{ENV['X_DEBIAN_SITEID']}"
+ ENV['RAILS_LOG'] = "/var/log/redmine/#{ENV['X_DEBIAN_SITEID']}"
diff --git a/debian/patches/gemfile-adjustments.patch b/debian/patches/gemfile-adjustments.patch
index 2d14466..ece642d 100644
--- a/debian/patches/gemfile-adjustments.patch
+++ b/debian/patches/gemfile-adjustments.patch
@@ -35,7 +35,7 @@
-database_file = File.join(File.dirname(__FILE__), "config/database.yml")
+# FIXME duplicating logic in config/application.rb
+ENV['X_DEBIAN_SITEID'] ||= 'default'
-+ENV['RAILS_ETC'] ||= "/etc/redmine/#{ENV['X_DEBIAN_SITEID']}"
++ENV['RAILS_ETC'] = "/etc/redmine/#{ENV['X_DEBIAN_SITEID']}"
+database_file = File.join(ENV['RAILS_ETC'], "database.yml")
if File.exist?(database_file)
database_config = YAML::load(ERB.new(IO.read(database_file)).result)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/redmine.git
More information about the Pkg-ruby-extras-commits
mailing list