Configuring Confitures

I am trying to create a package that has files under /etc that are not configuration. They are included in conffiles automatically even if I create an empty package.conffiles in the debian directory.

How can I stop dh_installdeb from this?

+4
source share
4 answers

Initially, this answer suggested providing your own debian/conffiles only with the actual configuration files to be installed. Apparently, this only adds more configuration files, but does not cancel the entire conffiles file.

However, I can’t understand why you wanted this. If the files are not configuration files, the user will not edit them, so no automatic envelope processing will be in your way when updating. Also, if they are not actually configuration files, I would strongly recommend just installing them in a place other than / etc, avoiding your problem.

0
source

I'm not sure I understand the answer of rafls, but dh_installdeb from debhelper=9.20120115ubuntu3 adds all below /etc for almost unlimited access: debian/conffiles adds conffiles, but does not override them.

It can be manually overridden in debian/rules . For example, to prevent files from being registered as conffiles:

 override_dh_installdeb: dh_installdeb find ${CURDIR}/debian/*/DEBIAN -name conffiles -delete 

(of course, the indentation should be hard)

+7
source

You can define the update rule in the 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 

Additional Information: The correct way to remove obsolete conffile in the Debian package

+2
source

This is what I came up with as a continuation of Vasily’s answer. It effectively accomplishes what dh_installdeb does, but without automatically adding /etc files. Thus, you again get full control over files that are considered conffiles and which are not.

 override_dh_installdeb: dh_installdeb @echo "Recreating conffiles without auto-adding /etc files" @for dir in ${CURDIR}/debian/*/DEBIAN; do \ PKG=$$(basename $$(dirname $$dir)); \ FILES=""; \ if [ -f ${CURDIR}/debian/conffiles ]; then \ FILES="${CURDIR}/debian/conffiles"; \ fi; \ if [ -f ${CURDIR}/debian/$${PKG}.conffiles ]; then \ FILES="$$FILES ${CURDIR}/debian/$${PKG}.conffiles"; \ fi; \ if [ -n "$$FILES" ]; then \ cat $$FILES | sort -u > $$dir/conffiles; \ elif [ -f $$dir/conffiles ]; then \ rm $$dir/conffiles; \ fi; \ done 

(Of course, use the REAL tabs if you insert rules into your file).

This answer uses BASH (or / bin / sh, which is either symbolically associated with BASH, or is a variant of it). There may be a way to achieve this using only internal makefile commands, but I'm not so good with them.

This should work even when creating multiple binary packages from the same source, and it respects the simple debian/conffiles , as well as the package specific debian/${pkg}.conffiles .

+1
source

All Articles