[Debconf-devel] Bug#616059: /usr/sbin/dpkg-reconfigure: should use dpkg-query --control-path to find path for templates/config files

Raphaël Hertzog hertzog at debian.org
Wed Mar 2 08:39:49 UTC 2011


Package: debconf
Version: 1.5.38
Severity: important
File: /usr/sbin/dpkg-reconfigure
User: debian-dpkg at lists.debian.org

dpkg's internal database will evolve with multiarch and you should not
have to hardcode this knowledge in your program. Instead of accessing
/var/lib/dpkg/info/foo.{templates,config} you should use
dpkg-query --control-path to find out the path to those files.

$ dpkg-query --control-path debconf
/var/lib/dpkg/info/debconf.templates
/var/lib/dpkg/info/debconf.md5sums
/var/lib/dpkg/info/debconf.prerm
/var/lib/dpkg/info/debconf.config
/var/lib/dpkg/info/debconf.preinst
/var/lib/dpkg/info/debconf.postinst
$ dpkg-query --control-path debconf templates
/var/lib/dpkg/info/debconf.templates
$ dpkg-query --control-path debconf config
/var/lib/dpkg/info/debconf.config

If the file doesn't exist, it will return nothing.

You must also be aware that users might ask "dpkg-reconfigure foo:i386" to
explain what version of the package they are referring to.

Cheers,
Raphaël.





More information about the Debconf-devel mailing list