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

Jérémy Lal kapouer-guest at alioth.debian.org
Thu Oct 14 23:10:14 UTC 2010


Author: kapouer-guest
Date: 2010-10-14 23:10:13 +0000 (Thu, 14 Oct 2010)
New Revision: 5925

Added:
   trunk/redmine/debian/patches/mysql_create_table_utf8.patch
Modified:
   trunk/redmine/debian/changelog
   trunk/redmine/debian/patches/disable-deprecations.patch
   trunk/redmine/debian/patches/series
   trunk/redmine/debian/postinst
Log:
Set mysql default table encoding to utf8 ; and database encoding to utf8 by using dbconfig-common special variables in postinst (the mysql special variable is not yet supported by dbconfig-common). Also remove the gem deprecation warning.

Modified: trunk/redmine/debian/changelog
===================================================================
--- trunk/redmine/debian/changelog	2010-10-13 17:33:39 UTC (rev 5924)
+++ trunk/redmine/debian/changelog	2010-10-14 23:10:13 UTC (rev 5925)
@@ -1,8 +1,14 @@
 redmine (1.0.2-2) unstable; urgency=low
 
-  * Update vi translation. (Closes: #598605) 
+  * Update vi translation. (Closes: #598605)
+  * Hint dbconfig-common so it creates mysql or pgsql databases
+    using UTF8 encoding, when that feature will be available.
+  * Patch ActiveRecord's MySql adapter so tables are created with
+    DEFAULT ENCODING = the one given in database.yml.
+    (Closes: #597652)
+  * Silence gem deprecation warnings in production env. (Closes: #599943)
 
- -- Jérémy Lal <kapouer at melix.org>  Thu, 30 Sep 2010 14:52:21 +0200
+ -- Jérémy Lal <kapouer at melix.org>  Fri, 15 Oct 2010 00:56:33 +0200
 
 redmine (1.0.2-1) unstable; urgency=low
 

Modified: trunk/redmine/debian/patches/disable-deprecations.patch
===================================================================
--- trunk/redmine/debian/patches/disable-deprecations.patch	2010-10-13 17:33:39 UTC (rev 5924)
+++ trunk/redmine/debian/patches/disable-deprecations.patch	2010-10-14 23:10:13 UTC (rev 5925)
@@ -3,11 +3,12 @@
 before release (see README.source), so the warnings won't be missed.
 --- a/config/environments/production.rb
 +++ b/config/environments/production.rb
-@@ -28,3 +28,7 @@
+@@ -28,3 +28,8 @@
  
  # No email in production log
  config.action_mailer.logger = nil
 +
-+# disable deprecation warnings
++# Disable deprecation warnings
 +ActiveSupport::Deprecation.silenced = true
++Gem::Dependency.warned_version_requirement = true
 +

Added: trunk/redmine/debian/patches/mysql_create_table_utf8.patch
===================================================================
--- trunk/redmine/debian/patches/mysql_create_table_utf8.patch	                        (rev 0)
+++ trunk/redmine/debian/patches/mysql_create_table_utf8.patch	2010-10-14 23:10:13 UTC (rev 5925)
@@ -0,0 +1,25 @@
+--- a/config/initializers/10-patches.rb
++++ b/config/initializers/10-patches.rb
+@@ -1,6 +1,22 @@
+ 
+ require 'active_record'
+ 
++require 'active_record/connection_adapters/abstract_adapter'
++module ActiveRecord
++  module ConnectionAdapters
++    class MysqlAdapter < AbstractAdapter
++      def create_table(table_name, options = {}) #:nodoc:
++        encoding = @config[:encoding]
++        if encoding
++          options = options.reverse_merge(:options => "DEFAULT CHARSET=#{encoding}")
++        end
++        super(table_name, options.reverse_merge(:options => "ENGINE=InnoDB"))
++      end
++    end
++  end
++end
++
++
+ module ActiveRecord
+   class Base
+     include Redmine::I18n

Modified: trunk/redmine/debian/patches/series
===================================================================
--- trunk/redmine/debian/patches/series	2010-10-13 17:33:39 UTC (rev 5924)
+++ trunk/redmine/debian/patches/series	2010-10-14 23:10:13 UTC (rev 5925)
@@ -5,3 +5,4 @@
 0017-dump_schema_to_cache_dir.patch
 0018-remove-shebang.patch
 disable-deprecations.patch
+mysql_create_table_utf8.patch

Modified: trunk/redmine/debian/postinst
===================================================================
--- trunk/redmine/debian/postinst	2010-10-13 17:33:39 UTC (rev 5924)
+++ trunk/redmine/debian/postinst	2010-10-14 23:10:13 UTC (rev 5925)
@@ -152,6 +152,9 @@
 		# this is for sqlite3 to be r/w for www-data
 		dbc_dbfile_perms="0660"
 		dbc_dbuser=redmine
+		# make sure mysql or pgsql database charset is UTF8
+		dbc_mysql_createdb_encoding="UTF8"
+		dbc_pgsql_createdb_encoding="UTF8"
 		# use same dbname if one has been registered in debconf before
 		# this is also needed for migration from version <= 0.9.0~svn2819
 		fCode=0
@@ -258,7 +261,7 @@
 			else
 				echo "Redmine instance \"${lInstance}\" database must be configured manually."
 			fi
-			cd $savedir
+			cd $savedir || true
 		;;
 	
 		abort-upgrade|abort-remove|abort-deconfigure)




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