[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#616060: /usr/sbin/dpkg-reconfigure: should use dpkg-query --control-path to find path for templates/config files



Package: cdebconf
Version: 0.154
Severity: important
File: /usr/sbin/dpkg-reconfigure
User: debian-dpkg@lists.debian.org
Usertags: multiarch

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.

$ dpkg-query --control-path debconf:i386 templates
/var/lib/dpkg/info/debconf.templates

Cheers,
Raphaël.




Reply to: