[Debian-l10n-commits] r2771 - /pootle/trunk/debian/pootle.postinst

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


Author: themill-guest
Date: Wed Nov 16 16:08:22 2011
New Revision: 2771

URL: http://svn.debian.org/wsvn/?sc=1&rev=2771
Log:
Fix default encoding for mysql installations

Modified:
    pootle/trunk/debian/pootle.postinst

Modified: pootle/trunk/debian/pootle.postinst
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/pootle.postinst?rev=2771&op=diff
==============================================================================
--- pootle/trunk/debian/pootle.postinst (original)
+++ pootle/trunk/debian/pootle.postinst Wed Nov 16 16:08:22 2011
@@ -67,6 +67,15 @@
     ) > /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
@@ -82,9 +91,10 @@
 }
 
 case "$1" in
-    configure)
+    configure|reconfigure)
         set_permissions
         configure_memcached
+        fix_db_encoding
         if [ -z "$2" ]; then
             # new installation
             su $POOTLE_USER -p -c "




More information about the Debian-l10n-commits mailing list