Bug#923142: Debconf option roundcube/language has no effect

2019-06-05 Thread Guilhem Moulin
Control: tag -1 pending

Hi there,

On Sun, 24 Feb 2019 at 15:07:54 +0300, Oleg Strikov wrote:
> I expected to see $config['language'] = 'ru_RU' in the configuration
> file after setting debconf option roundcube/language accordingly,
> but that's not what happened:

There were two problems:
 
  1. Unlike $config['default_host'] (for ‘roundcube/hosts’), there is no
 mention of $config['language'] in config.inc.php.sample, only in
 defaults.inc.php, as you mentioned.

  2. The ‘config’ maintainer script is run when the package is
 pre-configured, so file existence checks in
 /usr/share/roundcube/program/localization fail hence invalidate the
 debconf setting.  The workaround is to skip that part at
 pre-configure stage, and only run at postinst and reconfigure
 stage.

Cheers,
-- 
Guilhem.


signature.asc
Description: PGP signature


Bug#923142: Debconf option roundcube/language has no effect

2019-02-24 Thread Oleg Strikov
Package: roundcube
Version: 1.3.8+dfsg.1-2

I expected to see $config['language'] = 'ru_RU' in the configuration
file after setting debconf option roundcube/language accordingly,
but that's not what happened:

# echo roundcube-core roundcube/language string ru_RU | debconf-set-selections
# apt-get install roundcube
# grep language /etc/roundcube/config.inc.php || echo Not found
Not found

Postinst script roundcube-core.postinst has no way to add new lines to
the template placed at /usr/share/roundcube/config.inc.php.sample. It can
only modify values of existing variables. Current version of the template
doesn't contain $config['language'] line hence this variable can't be set
by postinst script during configuration.

Unfortunately, we can't simply copy $config['language'] line from
defaults.inc.php to config.inc.php.sample. If no $config['language'] line
exists in the configuration file or its value is null, roundcube uses
HTTP_ACCEPT_LANGUAGE-based language auto-detection, which is desired behavior.
Debconf sets roundcube/language to en_US (or some other language based on
locale) by default which would disable auto-detection for all installations
if this value gets propagated to the configuration file every time. In order
to avoid this, we need to add $config['language'] line to the configuration
file only if roundcube/language has been manually set (preseeded).