Comment 1 for bug 1840485

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

(c)root@tests:~$ echo 'bareos-database-common bareos-database-common/database-type select mysql' | debconf-set-selections

(c)root@tests:~$ echo 'bareos-database-common bareos-database-common/database-type seen true' | debconf-set-selections

(c)root@tests:~$ DEBIAN_FRONTEND=noninteractive dpkg-reconfigure -u bareos-database-common
(config) dbc_go() bareos-database-common reconfigure 2171.
dbc_config() bareos-database-common reconfigure 2171.
dbc_set_dbtype_defaults() .
dbc_detect_installed_dbtype() pgsql.
_dbc_detect_installed_dbtype() pgsql.
dbc_detect_installed_dbtype() mysql.
_dbc_detect_installed_dbtype() mysql.
dbc_register_debconf() .
dbc_read_package_config() .
dbc_preseed_package_debconf() .
dbc_config() bareos-database-common reconfigure 2171.
dbc_set_dbtype_defaults() pgsql.

The function responsible for setting the "default_dbtype" is:

dbc_set_dbtype_defaults()

like when there is only one supported database installed:

        # Only one installed supported dbtype found, let's use it.
        if ! echo "$dbc_dbtypes" | grep -q "," ; then
            dbc_dbtype=$dbc_default_dbtype
        fi

but it should NOT define another default database if the dbconf option "database-type" has been "seen" already.

So.. dbconfig-common has this bug and should NOT redefine database-type if it has been already changed (seen) since the package has been installed and configured.