Package: dbconfig-common
Version: 1.8.37
Severity: minor
Tags: patch
I'd like to specify a preference order for the supported dbtypes, so that
the default debconf choice would be the first one from my $dbc_dbtypes
list that is installed. Unfortunately dbconfig-common doesn't take
the order into account at all because it loops through the hardcoded
$dbc_all_supported_dbtypes and stops at the first good candidate.
Please consider the attached patch. It is suboptimal in the degenerate
case, when none of the $dbc_dbtypes are viable, but I think that means
something is wrong with either $dbc_dbtypes or the package dependencies.
PS. Many thanks for the 1.8.37 release!
Cheers,
--
Niko Tyni [EMAIL PROTECTED]
--- a/dpkg/config
+++ b/dpkg/config
@@ -3,7 +3,7 @@
###
dbc_go(){
- local f db happy default_dbtype host newhost port oldhosts authmethod_admin do_config _preconf_list _s _t STATE iformat ifile install_question migrating userdb_prio
+ local f db happy default_dbtype host newhost port oldhosts authmethod_admin do_config _preconf_list _s _t STATE iformat ifile install_question migrating userdb_prio supported_dbtypes
. /usr/share/dbconfig-common/dpkg/common
_dbc_debug "(config) dbc_go() $@"
@@ -116,8 +116,9 @@ dbc_go(){
dbc_dbtype=$dbc_hardcoded_dbtype
# else if the package supports multiple dbtypes, help them pick one
elif [ "$dbc_dbtypes" ]; then
- # loop through all available dbtypes
- for db in $dbc_all_supported_dbtypes; do
+ # loop through the listed dbtypes, fall back to all those available
+ supported_dbtypes=$(echo $dbc_dbtypes | sed 's/,/ /g')
+ for db in $supported_dbtypes $dbc_all_supported_dbtypes; do
# if we're already happy, we're already done
if [ "$happy" ]; then
true