[Debian-l10n-commits] r2780 - in /pootle/trunk/debian: mysql pootle.install pootle.postinst

themill-guest at users.alioth.debian.org themill-guest at users.alioth.debian.org
Wed Nov 16 16:08:47 UTC 2011


Author: themill-guest
Date: Wed Nov 16 16:08:47 2011
New Revision: 2780

URL: http://svn.debian.org/wsvn/?sc=1&rev=2780
Log:
Use dbconfig-common to set mysql charset

Added:
    pootle/trunk/debian/mysql
Modified:
    pootle/trunk/debian/pootle.install
    pootle/trunk/debian/pootle.postinst

Added: pootle/trunk/debian/mysql
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/mysql?rev=2780&op=file
==============================================================================
--- pootle/trunk/debian/mysql (added)
+++ pootle/trunk/debian/mysql Wed Nov 16 16:08:47 2011
@@ -1,0 +1,7 @@
+-- Set the default character set and collation for the mysql database prior
+-- to creating tables or putting data in it.
+--
+-- dbc_sql_substitutions should be set to have tags replaced by 
+-- dbconfig-common prior to running the SQL.
+
+ALTER DATABASE `_DBC_DBNAME_` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

Modified: pootle/trunk/debian/pootle.install
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/pootle.install?rev=2780&op=diff
==============================================================================
--- pootle/trunk/debian/pootle.install (original)
+++ pootle/trunk/debian/pootle.install Wed Nov 16 16:08:47 2011
@@ -1,2 +1,3 @@
 debian/dbconfig.template /usr/share/doc/pootle/
-debian/apache2.conf /usr/share/pootle/conf
+debian/apache2.conf /usr/share/pootle/conf/
+debian/mysql /usr/share/dbconfig-common/data/pootle/install/

Modified: pootle/trunk/debian/pootle.postinst
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/pootle.postinst?rev=2780&op=diff
==============================================================================
--- pootle/trunk/debian/pootle.postinst (original)
+++ pootle/trunk/debian/pootle.postinst Wed Nov 16 16:08:47 2011
@@ -11,6 +11,7 @@
 dbc_generate_include_owner='root:pootle'
 dbc_generate_include_perms='640'
 dbc_pgsql_createdb_encoding='UTF8'
+dbc_sql_substitutions='true'
 
 . /usr/share/debconf/confmodule
 # source dbconfig-common stuff');
@@ -67,15 +68,6 @@
     ) > /etc/pootle/debian_config.py
 }
 
-fix_db_encoding() {
-    case "$dbc_dbtype" in
-        mysql)
-            . /usr/share/dbconfig-common/internal/mysql
-            dbc_mysql_exec_command "ALTER DATABASE $dbc_dbname DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci" || true
-        ;;
-    esac
-}
-
 move_po_files() {
     cd $POOTLE_HOME
     for d in *; do
@@ -125,7 +117,6 @@
     configure|reconfigure)
         set_permissions
         configure_memcached
-        fix_db_encoding
         if [ -z "$2" ]; then
             # new installation
             if [ $dbc_install != 'false' ]; then




More information about the Debian-l10n-commits mailing list