Web lists-archives.com

Re: Clearing the conffile status of a file




On 2017-07-12 09:56 +0200, Florian Weimer wrote:

> I've got a request to remove the conffile status of a file after it is
> no longer a conffile.  dpkg-maintscript-helper rm_conffile does not
> seem to do this, based on the documentation and the source code.
>
> Is there a clean way to implement this (i.e., by not patching
> /var/lib/dpkg/status directly)?

AFAIK the only method, and not a pretty one, that works from package
maintainer scripts is to rename the file in the preinst and rename it
back in the postinst.  Plus all the error handling required (e.g. if
unpacking fails), where dpkg-maintscript-helper would at least take care
of the gory details[1] for you.

> If there is a way, is there a reason not do it?

There is a time window between the preinst and the postinst where the
file is not available, which might be problematic.

My choice would probably be to leave the conffile alone, at least until
dpkg itself is able to take care of the problem[2].

Cheers,
       Sven


1. https://wiki.debian.org/DpkgConffileHandling
2. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=822462