Hi,

On 2024-07-25 00:34, Lee Garrett wrote:
> So when /etc/locale.gen exists, this file is read, and then the settings in
> the debconf database overwritten by those value. So once debconf is
> installed, there's no programmatic way via debconf to change the locale. A
> workaround is template the files /etc/locale.gen and /etc/locale.conf and
> then run dpkg-reconfigure locales.

Yes, this works exactly as expected. debconf can be used to preconfigure
the package before it gets installed. But *debconf is not a registry*. The
way to change the configuration is by editing the files.

This is very clear in the debconf manual:

"You can also use debconf in other, standalone programs. The issue to watch out
for here is that debconf is not intended to be, and must not be used as a
registry. This is unix after all, and programs are configured by files in /etc,
not by some nebulous debconf database (that is only a cache anyway and might
get blown away). So think long and hard before using debconf in a standalone
program."

https://manpages.debian.org/unstable/debconf-doc/debconf-devel.7.en.html

> This however seems counterintuitive to me, as practically all other packages
> using debconf have the debconf database as authoritative data from which the
> config is written (e.g. apt-cacher-ng, ca-certificates, console-setup,
> iproute2, grub-efi-amd64, grub-pc, postfix, tzdata, wireshark-common, to
> name a few).

Then those packages are buggy, please report bugs. And I really doubt
about the behaviour you describe, for at least tzdata.

> Neither /etc/locale.gen, nor /etc/locale.conf are marked as conffiles, so
> they shouldn't edited by users, and neither be preserved, nor authoritative
> on the matter. As such, I'm raising the bug severity.

They are not conffiles, because there are not mandatory and thus not
shipped by the package. But it's something we can change.

In any case, as you raised the bug to serious, could you please tell me
which section of the Debian policy is violated?
 
> I propose to remove the shown code lines from locales.config. This would
> make any debconf selections authoritative again.

As said above this is wrong.

> A compromise would be to add another debconf option that decides on which
> side is authoritative (either config file, or debconf), but IMHO that adds
> complexity without much benefit.

I agree with you it should not be done.

Regards
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurel...@aurel32.net                     http://aurel32.net

Reply via email to