[Dbconfig-common-devel] dynamic list of supported database types

Niko Tyni ntyni at debian.org
Fri Mar 7 13:20:51 UTC 2008


Hi Sean and other dbconfig-common folks,

I already brought this up on debian-mentors [1], but it might make sense
to consider this from the dbconfig-common POV too.

I'm working on adding dbconfig-common support to request-tracker3.6,
and the database dependencies are somewhat of a jungle. RT supports the
usual mix of mysql,pg, and sqlite, but in addition to the client package
it requires the corresponding libdbd-*-perl package too.

To make sure the right combinations get installed, I'm planning to
divide the dependencies into separate backend packages, eg.
rt3.6-db-postgresql and the like.

 Package: request-tracker3.6
 Depends: rt3.6-db-mysql | rt3.6-db-postgresql | rt3.6-db-sqlite

 Package: rt3.6-db-mysql
 Depends: libdbd-mysql-perl (>= 2.1018), mysql-client-5.0 | mysql-client (>= 4.0.13)
 Suggests: mysql-server-5.0 | mysql-server (>= 4.0.13)

etc.

I'd like to make sure that the admin is presented with a list of only
those dbtypes with the matching backend package (being) installed, mainly
to avoid errors due to missing libdbd-*-perl packages.  I've got this
working by setting an internal debconf variable from the rt3.6-db-*
config scripts and then building $dbc_dbtypes from those in the
request-tracker3.6 config script.

Barring surprises in .config script execution order (which is what the
debian-mentors post was about), this seems to work. If the .config script
of request-tracker3.6 somehow does get run before the rt3.6-db-* ones,
I can always defer the configuration to postinst time.

Now, is this doomed to fail for some reason that I can't see?  
Does this generalize to something that could be added in dbconfig-common
itself? I'm thinking of something like an interface to add extra
requirements to dbc_detect_installed_dbtype(), but that currently only
affects the default choice and not the list contents anyway...

An interface to override dbc_detect_installed_dbtype() might be nice
in any case - I don't really care if a database client is installed at
.config time if I'm taking care myself that it will be at postinst time.

Ideas and comments welcome, hope I'm making sense. Please tell me if
it's all overkill and not worth the trouble :)

[1] http://lists.debian.org/debian-mentors/2008/03/msg00079.html

Cheers,
-- 
Niko Tyni   ntyni at debian.org



More information about the Dbconfig-common-devel mailing list