Goal: replace files in /etc/zsh from package zsh with files from package grml-etc. Store original files via dpkg-divert and when purging grml-etc restore them.
Ok: use debian/preinst with dpkg-divert and don’t put the config files in the file ‘conffiles’. And wonder why it doesn’t work as it maybe should. Why? Files are put into ‘conffiles’ on “their own”:
find debian/grml-etc/etc -type f -printf '/etc/%P' >> debian/grml-etc/DEBIAN/conffiles
So you have to work around it via:
dh_installdeb cp $(CURDIR)/debian/conffiles $(CURDIR)/debian/grml-etc/DEBIAN
Might be a well known issue but if you don’t know that it can cause pain till you set DH_VERBOSE=1.
And why does www.debian.org/doc/ not provide an index? grml.