Hi! On Wed, 2017-03-22 at 01:11:43 +0000, Clint Adams wrote: > On Sun, Apr 24, 2016 at 02:20:50PM -0400, Daniel Kahn Gillmor wrote: > > Currently, if a package drops a config file, the package maintainer > > has to invoke: > > > > dpkg-maintscript-helper rm_conffile $CONFFILE $PRIOR_VERSION $PKGNAME -- > > "$@" > > > > in the package's prinst, postinst, and postrm maintainer scripts. > > > > Instead, dpkg should be aware of the dropped config file and handle it > > automatically.
> Are you suggesting that dpkg would diff the prior .conffiles with the in-.deb > control file, and perform the equivalent of dpkg-maintscript-helper > rm_conffile > on each line that is deleted, and then make `dpkg-maintscript-helper > rm_conffile` > a no-op? dpkg already knows when a conffile gets dropped, and marks it appropriately as "obsolete" in its Conffiles field on the db. It could already remove those whenever they have not been locally modified, which is something I should probably do for 1.19.x, after some careful consideration (that would be #330256). > > This will help us to reduce some of the need for maintainer scripts, > > making the archive more maintainable and auditable. Not really, because even if dpkg can handle the case of unmodified conffiles, it cannot handle the case of modified ones. As it does not know if those are intended to be renamed, removed, switched to manual config-files or are changing package ownership. I've not merged this bug with #330256, because I understand the underlaying request here is not covered by the other bug, i.e. make dpkg-maintscript-helper unnecessary. So that we can switch to more declarative packages. This could be solved by marking such actions in the conffile control file when packaging the .deb, and then making dpkg itself perform the actions now done by the helper. For example, this completely made-up and not thought-very-deeply syntax: ,--- DEBIAN/conffiles --- /etc/some-file /etc/other-file /etc/obsolete-file remove /etc/old-file rename /etc/new-file /etc/move-file move new-package /etc/manual-file handled `--- Thanks, Guillem

