I'm trying to build a package which has some files under /etc
that are not configuration. They are included in the conffiles
automatically even if I create an empty package.conffiles
in the debian
directory.
How can I stop dh_installdeb
from doing that?
I’m not sure I understand rafl’s answer, but dh_installdeb
as of debhelper=9.20120115ubuntu3
adds everything below /etc
to conffiles nearly unconditionally: debian/conffiles
adds conffiles but does not override them.
It’s possible to override manually in debian/rules
. For example, in order to prevent any files from being registered as conffiles:
override_dh_installdeb:
dh_installdeb
find ${CURDIR}/debian/*/DEBIAN -name conffiles -delete
(of course, indentation must be hard tab)
It's possible to define a upgrade rule at preinst script in debian/<package-name>.preinst
using dpkg-maintscript-helper.
#!/bin/sh
# preinst script for <package-name>
set -e
case "$1" in
install|upgrade)
if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
dpkg-maintscript-helper rm_conffile /etc/foo/conf.d/bar <Previous package version> -- "$@"
fi
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0
More info: The right way to remove an obsolete conffile in a Debian package
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With