[DRE-commits] [redmine] 01/01: load all database drivers for all Redmine instances

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Apr 10 14:58:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch debian/jessie
in repository redmine.

commit fd94f08fc4ba2503bd71b3ebd782ba0b93679351
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Sun Apr 3 20:48:31 2016 -0300

    load all database drivers for all Redmine instances
    
    Closes: #819815
---
 debian/changelog                         |  7 +++++++
 debian/patches/gemfile-adjustments.patch | 35 +++++++++++++++++++-------------
 2 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c4db2f7..ec0e42a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+redmine (3.0~20140825-8~deb8u3) jessie; urgency=medium
+
+  * gemfile-adjustments.patch: load all database drivers for all Redmine
+    instances (Closes: #819815)
+
+ -- Antonio Terceiro <terceiro at debian.org>  Sun, 03 Apr 2016 20:47:00 -0300
+
 redmine (3.0~20140825-8~deb8u2) jessie-security; urgency=high
 
   * Security update. Includes fixes for the following vulnerabilities:
diff --git a/debian/patches/gemfile-adjustments.patch b/debian/patches/gemfile-adjustments.patch
index 3a2f6e1..0db0aa3 100644
--- a/debian/patches/gemfile-adjustments.patch
+++ b/debian/patches/gemfile-adjustments.patch
@@ -37,24 +37,33 @@
    end
  end
  
-@@ -46,8 +46,11 @@ end
+@@ -46,12 +46,16 @@ end
  # configuration file
  require 'erb'
  require 'yaml'
 -database_file = File.join(File.dirname(__FILE__), "config/database.yml")
 -if File.exist?(database_file)
-+# FIXME duplicating logic in config/application.rb
-+ENV['X_DEBIAN_SITEID'] ||= 'default'
-+ENV['RAILS_ETC'] = "/etc/redmine/#{ENV['X_DEBIAN_SITEID']}"
-+database_file = File.join(ENV['RAILS_ETC'], "database.yml")
-+if File.readable?(database_file)
++seen_adapters = {}
++Dir['{config,/etc/redmine/*}/database.yml'].select do |f|
++  File.exists?(f)
++end.each do |database_file|
    database_config = YAML::load(ERB.new(IO.read(database_file)).result)
    adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
    if adapters.any?
-@@ -78,21 +81,6 @@ else
-   warn("Please configure your config/database.yml first")
- end
- 
+     adapters.each do |adapter|
++      next if seen_adapters[adapter]
++      seen_adapters[adapter] = true
+       case adapter
+       when 'mysql2'
+         gem "mysql2", "~> 0.3.11", :platforms => [:mri, :mingw]
+@@ -74,23 +78,6 @@ if File.exist?(database_file)
+   else
+     warn("No adapter found in config/database.yml, please configure it first")
+   end
+-else
+-  warn("Please configure your config/database.yml first")
+-end
+-
 -group :development do
 -  gem "rdoc", ">= 2.4.2"
 -  gem "yard"
@@ -68,8 +77,6 @@
 -  # For running UI tests
 -  gem "capybara", "~> 2.1.0"
 -  gem "selenium-webdriver"
--end
--
+ end
+ 
  local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
- if File.exists?(local_gemfile)
-   eval_gemfile local_gemfile

-- 
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