[Debian-l10n-commits] r2646 - in /pootle/trunk/debian: changelog dbconfig.template patches/debian_use_dbconfig.patch pootle.config pootle.postrm

bubulle at users.alioth.debian.org bubulle at users.alioth.debian.org
Fri May 27 17:27:02 UTC 2011


Author: bubulle
Date: Fri May 27 17:27:02 2011
New Revision: 2646

URL: http://svn.debian.org/wsvn/?sc=1&rev=2646
Log:
Add files for dbconfig-common support

Added:
    pootle/trunk/debian/dbconfig.template
    pootle/trunk/debian/patches/debian_use_dbconfig.patch
    pootle/trunk/debian/pootle.config
    pootle/trunk/debian/pootle.postrm
Modified:
    pootle/trunk/debian/changelog

Modified: pootle/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/changelog?rev=2646&op=diff
==============================================================================
--- pootle/trunk/debian/changelog (original)
+++ pootle/trunk/debian/changelog Fri May 27 17:27:02 2011
@@ -10,6 +10,7 @@
   * debian/pootle.config, debian/pootle.postinst, debian/pootle.prerm,
     debian.pootle.postrm: Use dbconfig-common to configure database
     Closes: #590518
+  * recommend "mysql-server | postgresql-server"
 
  -- Christian Perrier <bubulle at debian.org>  Fri, 27 Aug 2010 07:56:07 +0200
 

Added: pootle/trunk/debian/dbconfig.template
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/dbconfig.template?rev=2646&op=file
==============================================================================
--- pootle/trunk/debian/dbconfig.template (added)
+++ pootle/trunk/debian/dbconfig.template Fri May 27 17:27:02 2011
@@ -1,0 +1,9 @@
+DATABASE_ENGINE = '_DBC_DBTYPE_'                 # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+DATABASE_NAME = '_DBC_DBNAME_'                   # Or path to database file if using sqlite3.
+DATABASE_USER = '_DBC_DBUSER_'                   # Not used with sqlite3.
+DATABASE_PASSWORD = '_DBC_DBPASS_'               # Not used with sqlite3.
+DATABASE_HOST = '_DBC_DBSERVER_'                   # Set to empty string for localhost. Not used with sqlite3.
+DATABASE_PORT = '_DBC_DBPORT_'                   # Set to empty string for default. Not used with sqlite3.
+
+if DATABASE_ENGINE == 'pgsql':
+   DATABASE_ENGINE = 'postgresql_psycopg2'

Added: pootle/trunk/debian/patches/debian_use_dbconfig.patch
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/patches/debian_use_dbconfig.patch?rev=2646&op=file
==============================================================================
--- pootle/trunk/debian/patches/debian_use_dbconfig.patch (added)
+++ pootle/trunk/debian/patches/debian_use_dbconfig.patch Fri May 27 17:27:02 2011
@@ -1,0 +1,16 @@
+--- a/localsettings.py    (revision 2328)
++++ b/localsettings.py    (working copy)
+@@ -16,12 +16,8 @@
+ 
+ 
+ # Database configuration
+-DATABASE_ENGINE = 'sqlite3'                 # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+-DATABASE_NAME = working_path('dbs/pootle.db') # Or path to database file if using sqlite3.
+-DATABASE_USER = ''                          # Not used with sqlite3.
+-DATABASE_PASSWORD = ''                      # Not used with sqlite3.
+-DATABASE_HOST = ''                          # Set to empty string for localhost. Not used with sqlite3.
+-DATABASE_PORT = ''                          # Set to empty string for default. Not used with sqlite3.
++# load debian dbconfig
++execfile(config_path("dbconfig.py"))
+ 
+ STATS_DB_PATH = working_path('dbs/stats.db') # None means the default path

Added: pootle/trunk/debian/pootle.config
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/pootle.config?rev=2646&op=file
==============================================================================
--- pootle/trunk/debian/pootle.config (added)
+++ pootle/trunk/debian/pootle.config Fri May 27 17:27:02 2011
@@ -1,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
+        dbc_dbtypes="mysql, pgsql"
+        dbc_authmethod_user="password"
+        #dbc_first_version="2.0.5-2"
+        . /usr/share/dbconfig-common/dpkg/config 
+        dbc_go pootle $@
+fi

Added: pootle/trunk/debian/pootle.postrm
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/pootle.postrm?rev=2646&op=file
==============================================================================
--- pootle/trunk/debian/pootle.postrm (added)
+++ pootle/trunk/debian/pootle.postrm Fri May 27 17:27:02 2011
@@ -1,0 +1,22 @@
+#!/bin/sh
+
+set -e
+#set -x
+
+if [ -f /usr/share/debconf/confmodule ]; then
+        . /usr/share/debconf/confmodule
+fi
+if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
+        . /usr/share/dbconfig-common/dpkg/postrm 
+        dbc_go db-test-multidbtype $@
+fi
+
+if [ "$1" = "purge" ]; then
+        rm -f /etc/pootle/dbconfig.py
+        if which ucf >/dev/null 2>&1; then
+                ucf --purge /etc/pootle/dbconfig.py
+                ucfr --purge pootle /etc/pootle/dbconfig.py
+        fi
+fi
+
+#DEBHELPER#




More information about the Debian-l10n-commits mailing list