On Fri, 2025-01-10 at 16:45 +0000, Mark Hindley wrote:
> Hristo,
> 
> Thanks for this. I have been giving it some thought, but it is a
> thorny issue
> and I have not found a good solution (yet?).
> 
> The root of the issue is alluded to in Debian Policy[1]: sharing and
> diverting
> configuration files is at best discouraged and likely to be broken.
> 
> On that basis I am minded to close this as wontfix. Does that seem
> reasonable?

Perhaps it is.

What I'm looking for is a way to manage configuration files. For me
practically all configuration files (there are few exceptions, most
notably `/etc/passwd`) fall into one of two categories:

- The configuration file is provided by the package in one way or
another, and its contents are always exactly what is provided by the
package without any modification.

- The configuration file is provided by the user. Any package
management operations must not modify the configuration file.

Ideally it would be possible keep a list of the configuration files
that fall into the second category and apply it automatically. This
would restore the original contents of all files removed from the list,
and ensure that newly-added files will no longer be modified by package
updates.

Using `dpkg-divert --rename` + `dpkg --force-confnew,confmiss,confask`
seems to work pretty well for dpkg-managed conffiles. The list of
diversions is maintained to be exactly the list of user-managed
configuration files.

For ucf-managed configuration files, however, things are a bit more
difficult. In my case all of them happen to fall into the second
category, so currently my `/etc/ucf.conf` is `exit 0`. This works for
now, but it is not ideal, and will become worse if more packages start
using ucf.

> 
> Mark
> 
> [1] 
> https://www.debian.org/doc/debian-policy/ch-files.html#sharing-configuration-files
> 

Reply via email to