[Dbconfig-common-changes] [dbconfig-common] r325 - in trunk: debian
doc examples/db-test-multidbtype-2.0/debian
examples/db-test-mysql-2.0/debian examples/db-test-mysql-2.1/debian
examples/db-test-mysql-frontend-2.0/debian
examples/db-test-mysql-perl-2.0/debian
examples/db-test-pgsql-2.0/debian
examples/db-test-pgsql-migration-2.0/debian
examples/db-test-sqlite-2.0/debian
Sean Finney
seanius at costa.debian.org
Mon Sep 18 20:52:07 CEST 2006
Author: seanius
Date: 2006-09-18 18:52:06 +0000 (Mon, 18 Sep 2006)
New Revision: 325
Modified:
trunk/debian/changelog
trunk/doc/dbconfig-common.sgml
trunk/examples/db-test-multidbtype-2.0/debian/config
trunk/examples/db-test-mysql-2.0/debian/config
trunk/examples/db-test-mysql-2.1/debian/config
trunk/examples/db-test-mysql-frontend-2.0/debian/config
trunk/examples/db-test-mysql-perl-2.0/debian/config
trunk/examples/db-test-pgsql-2.0/debian/config
trunk/examples/db-test-pgsql-migration-2.0/debian/config
trunk/examples/db-test-sqlite-2.0/debian/config
Log:
updated docs and examples wrt the config script
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2006-09-10 10:07:47 UTC (rev 324)
+++ trunk/debian/changelog 2006-09-18 18:52:06 UTC (rev 325)
@@ -1,7 +1,11 @@
dbconfig-common (1.8.22) UNRELEASED; urgency=low
[ sean finney ]
- * NOT RELEASED YET
+ * added note about needing to check for dbconfig-common in the config
+ script before sourcing the shell library (for situations where
+ apt or similar utilities preconfigure the package before dependencies
+ are unpacked).
+ * updated examples as well.
* updated danish translations by Claus Hindsgaul (closes: #385688).
* updated czech translations by Miroslav Kure (closes: #386022).
Modified: trunk/doc/dbconfig-common.sgml
===================================================================
--- trunk/doc/dbconfig-common.sgml 2006-09-10 10:07:47 UTC (rev 324)
+++ trunk/doc/dbconfig-common.sgml 2006-09-18 18:52:06 UTC (rev 325)
@@ -77,11 +77,12 @@
both the local admin <em>and</em> the package maintainer :)
<sect1 id="hooks">putting hooks into the maintainer scripts
<p>
- in the <var>postinst</var>, <var>prerm</var>, and
- <var>postrm</var> scripts for your package, you
- will need to source the libraries which perform
- most of the work for you (you do not need to
- do so in your <var>preinst</var> script). if you are
+ in the <var>config</var>, <var>postinst</var>,
+ <var>prerm</var>, and <var>postrm</var> scripts
+ for your package, you will need to source the
+ libraries which perform most of the work for you
+ (you do not need to do so in your
+ <var>preinst</var> script). if you are
not currently using debconf in your package,
you will be now, and the debconf libraries
need to be sourced first. you will need to
@@ -89,36 +90,18 @@
dh_installdebconf or otherwise install your
<var>config</var> script into your deb file
if you're not already doing so. for example,
- here's an what it should look like in a <var>postinst</var>
+ here's an what it might look like in a <var>config</var>
script for an imaginary
<package>foo-mysql</package> package:
<example>
#!/bin/sh
-# postinst maintainer script for foo-mysql
+# config maintainer script for foo-mysql
# source debconf stuff
. /usr/share/debconf/confmodule
-# source dbconfig-common stuff
-. /usr/share/dbconfig-common/dpkg/postinst.mysql
-dbc_go foo-mysql $@
-
-# ... rest of your code ...
- </example>
- <p>
- <em>NOTE</em>: to stay compliant with Policy 7.2, you need
- to do something slightly different in your <var>postrm</var>
- script:
- <example>
-#!/bin/sh
-# postrm maintainer script for foo-mysql
-
-# source debconf stuff
-if [ -f /usr/share/debconf/confmodule ]; then
- . /usr/share/debconf/confmodule
-fi
-# source dbconfig-common stuff
-if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then
- . /usr/share/dbconfig-common/dpkg/postrm.mysql
+# source dbconfig-common shell library, and call the hook function
+if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
+ . /usr/share/dbconfig-common/dpkg/config.mysql
dbc_go foo-mysql $@
fi
@@ -134,7 +117,8 @@
clean way to figure this out automatically),
and <var>$@</var> (the arguments which were
passed to the maintainer script).
-
+ <p>
+ <em>NOTE</em>: you do not need to conditionally test for the existance of the shell library in the <var>postinst</var> and <var>prerm</var> scripts, but to stay compliant with Policy section 7.2 you do need to do so at least in your <var>config</var> and <var>postrm</var> scripts.
<p>
note that if your package does not use debconf,
you will need to explicitly install the
Modified: trunk/examples/db-test-multidbtype-2.0/debian/config
===================================================================
--- trunk/examples/db-test-multidbtype-2.0/debian/config 2006-09-10 10:07:47 UTC (rev 324)
+++ trunk/examples/db-test-multidbtype-2.0/debian/config 2006-09-18 18:52:06 UTC (rev 325)
@@ -5,6 +5,8 @@
. /usr/share/debconf/confmodule
-dbc_dbtypes="mysql, pgsql"
-. /usr/share/dbconfig-common/dpkg/config
-dbc_go db-test-multidbtype $@
+if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
+ dbc_dbtypes="mysql, pgsql"
+ . /usr/share/dbconfig-common/dpkg/config
+ dbc_go db-test-multidbtype $@
+fi
Modified: trunk/examples/db-test-mysql-2.0/debian/config
===================================================================
--- trunk/examples/db-test-mysql-2.0/debian/config 2006-09-10 10:07:47 UTC (rev 324)
+++ trunk/examples/db-test-mysql-2.0/debian/config 2006-09-18 18:52:06 UTC (rev 325)
@@ -4,5 +4,7 @@
#set -x
. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/config.mysql
-dbc_go db-test-mysql $@
+if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
+ . /usr/share/dbconfig-common/dpkg/config.mysql
+ dbc_go db-test-mysql $@
+fi
Modified: trunk/examples/db-test-mysql-2.1/debian/config
===================================================================
--- trunk/examples/db-test-mysql-2.1/debian/config 2006-09-10 10:07:47 UTC (rev 324)
+++ trunk/examples/db-test-mysql-2.1/debian/config 2006-09-18 18:52:06 UTC (rev 325)
@@ -4,5 +4,7 @@
#set -x
. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/config.mysql
-dbc_go db-test-mysql $@
+if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
+ . /usr/share/dbconfig-common/dpkg/config.mysql
+ dbc_go db-test-mysql $@
+fi
Modified: trunk/examples/db-test-mysql-frontend-2.0/debian/config
===================================================================
--- trunk/examples/db-test-mysql-frontend-2.0/debian/config 2006-09-10 10:07:47 UTC (rev 324)
+++ trunk/examples/db-test-mysql-frontend-2.0/debian/config 2006-09-18 18:52:06 UTC (rev 325)
@@ -4,5 +4,7 @@
#set -x
. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/frontend.config.mysql
-dbc_go db-test-mysql-frontend $@
+if [ -f /usr/share/dbconfig-common/dpkg/frontend.config.mysql ]; then
+ . /usr/share/dbconfig-common/dpkg/frontend.config.mysql
+ dbc_go db-test-mysql-frontend $@
+fi
Modified: trunk/examples/db-test-mysql-perl-2.0/debian/config
===================================================================
--- trunk/examples/db-test-mysql-perl-2.0/debian/config 2006-09-10 10:07:47 UTC (rev 324)
+++ trunk/examples/db-test-mysql-perl-2.0/debian/config 2006-09-18 18:52:06 UTC (rev 325)
@@ -4,5 +4,7 @@
#set -x
. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/config.mysql
-dbc_go db-test-mysql-perl $@
+if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
+ . /usr/share/dbconfig-common/dpkg/config.mysql
+ dbc_go db-test-mysql-perl $@
+fi
Modified: trunk/examples/db-test-pgsql-2.0/debian/config
===================================================================
--- trunk/examples/db-test-pgsql-2.0/debian/config 2006-09-10 10:07:47 UTC (rev 324)
+++ trunk/examples/db-test-pgsql-2.0/debian/config 2006-09-18 18:52:06 UTC (rev 325)
@@ -4,7 +4,9 @@
#set -x
. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/config.pgsql
-#dbc_authmethod_user="password"
-dbc_go db-test-pgsql $@
+if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then
+ . /usr/share/dbconfig-common/dpkg/config.pgsql
+ #dbc_authmethod_user="password"
+ dbc_go db-test-pgsql $@
+fi
Modified: trunk/examples/db-test-pgsql-migration-2.0/debian/config
===================================================================
--- trunk/examples/db-test-pgsql-migration-2.0/debian/config 2006-09-10 10:07:47 UTC (rev 324)
+++ trunk/examples/db-test-pgsql-migration-2.0/debian/config 2006-09-18 18:52:06 UTC (rev 325)
@@ -4,10 +4,12 @@
#set -x
. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/config.pgsql
-# the previous version (1.9) didn't use dbconfig-common. this is
-# how we accomodate users who already have this old version installed:
-dbc_first_version="2.0"
-dbc_load_include="sh:/etc/db-test-pgsql-migration/db.conf"
-dbc_go db-test-pgsql-migration $@
+if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then
+ . /usr/share/dbconfig-common/dpkg/config.pgsql
+ # the previous version (1.9) didn't use dbconfig-common. this is
+ # how we accomodate users who already have this old version installed:
+ dbc_first_version="2.0"
+ dbc_load_include="sh:/etc/db-test-pgsql-migration/db.conf"
+ dbc_go db-test-pgsql-migration $@
+fi
Modified: trunk/examples/db-test-sqlite-2.0/debian/config
===================================================================
--- trunk/examples/db-test-sqlite-2.0/debian/config 2006-09-10 10:07:47 UTC (rev 324)
+++ trunk/examples/db-test-sqlite-2.0/debian/config 2006-09-18 18:52:06 UTC (rev 325)
@@ -4,5 +4,7 @@
#set -x
. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/config.sqlite
-dbc_go db-test-sqlite $@
+if [ -f /usr/share/dbconfig-common/dpkg/config.sqlite ]; then
+ . /usr/share/dbconfig-common/dpkg/config.sqlite
+ dbc_go db-test-sqlite $@
+fi
More information about the Dbconfig-common-changes
mailing list