Package: dpkg
Version: 1.21.1
Severity: wishlist
File: /usr/bin/dpkg-maintscript-helper

If the conffile affected by `dpkg-maintscript-helper rm_conffile` has been
modified, d-m-h moves it out of the way by renaming it to
conffile.dpkg-backup and then to conffile.dpkg-bak. This seems like
an appropriate thing to do if you are removing a "monolithic" conffile
similar to /etc/wgetrc.

I think it would be useful to have a mode (perhaps rm_conffile_if_unmodified)
that will remove unmodified conffiles, but leave a modified file in place:

- preinst: if unmodified, rename conffile to conffile.dpkg-remove
- postinst: remove conffile.dpkg-remove if present
- postrm: on abort, rename conffile.dpkg-remove to conffile

This is exactly the half of rm_conffile that deals with unmodified
conffiles, but converting the half that deals with modified conffiles
into a no-op, and it seems like the right thing to do if you are removing
a snippet in a .d directory, similar to the ones in /etc/dpkg/dpkg.cfg.d/.

In particular, this seems like it would be the right thing to use
when moving an integration-point file (udev rules, dbus-daemon policy,
etc.) from /etc into /usr in order to reserve /usr for sysadmin overrides,
which is a common pattern. If the file in /etc has been modified, then
it should stay intact with its original name so that it continues to
override the package's version in /usr; but if the file in /etc has not
been modified, then it should be removed so that the package's updated
version can be used.

    smcv

Reply via email to