[Dbconfig-common-devel] self-defined values for _DBC_DBTYPE_ in frontend's code
sean finney
seanius at debian.org
Thu Sep 6 17:05:02 UTC 2007
hiya,
On Thursday 06 September 2007 11:23:21 am Michael Ablassmeier wrote:
> As it stands dbc_dbtypes nees to be set to "mysql, pgsql" in order work
> correctly, otherwise usr/share/dbconfig-common/dpkg/postinst bails out
>
> with the following error:
> > Creating config file /etc/zabbix/dbconfig.php with new version
> > /usr/share/dbconfig-common/dpkg/postinst: line 68:
> > dbc_MYSQL_db_installed: command not found warning: database package not
> > installed?
> > dbconfig-common: zabbix-frontend-php configure: aborted.
yeah, i would not expect that to work. there are also a lot of other parts in the code that have stuff like test "$dbc_dbtype" = "mysql" etc.
> would it be possible to introduce a new value like dbc_dbtype_value or
> something in order to be able to define a custom value which should be set?
> Is there another way to get this working? We dont want to mess with our
> application's php scripts.
i have two suggestions, both of which would work with the current version of dbconfig-commont:
(a) put some logic in your config file. that is, you could easily modify your config file so that it sets the appropriate value:
<?php
if($dbtype == "mysql") { $dbtype = "MYSQL"; }
else ...
?>
or
<?php
$dbtype = strtoupper($dbtype);
?>
(b) use dbconfig-common's template output to generate a temporary output file, and then pipe it through sed and ucf-register it yourself in your postinst
#!/bin/sh -e
....
dbconfig-generate-include -f template -o template-outfile=sometmpfile /etc/dbconfig-common/yourpkg.conf
sed -i -e 's/mysql/MYSQL/g' -e ... sometmpfile
ucf sometmpfile /etc/where-it-goes.php
hth,
sean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.alioth.debian.org/pipermail/dbconfig-common-devel/attachments/20070906/5f8707f6/attachment.pgp
More information about the Dbconfig-common-devel
mailing list