The purpose of this page is to get parts of debconf better integrated into dpkg. One reason to do this is so we don't have to redo the same nasty hacks in cdebconf when we replace debconf with it. -- JoeyHess
Running config scripts
Currently accomplished by evil hacks in /usr/share/debconf/frontend, which is run when a postinst or preinst is run.
dpkg could be taught about config script and debconf template files, and use an interface or hook to communicate with debconf. Debconf's requirements of such an interface or hook are:
- Needs to happen before the preinst of the package is run.
- If there is a postinst, and no preinst, it needs to happen at least before the postinst is run.
- It would be ok if it happened before both the preinst and the postinst. The config script can be run multiple times with no ill effects.
- Debconf needs to be passed the name of the package, the version being installed, and somehow given access to the templates file and config script from the control.tar.gz of the package.
- It's ok if debconf is started several times during an apt run, or even multiple times during a single dpkg run.
- There needs to be a way for debconf to communicate back to dpkg that the config script failed, and dpkg should fail the package installation appropriately (probably treating the failure as a preinst or postinst failure, depending on before which it ran debconf).
- If dpkg runs a preinst or postinst in an error unwind state or other unusual state (abort-remove, triggered, whatever), it should probably also call debconf before calling the script. (I don't know if this matters, but that happens now via debconf's hacks, and something might somehow rely on it.)
Has dpkg in its name, but is so tightly wed to the debconf libraries that it really has nothing to do with dpkg.
dpkg --preconfigure could exec it
In apt, use by dpkg-preconfigure, could go to dpkg. Impact on debconf if it does is small.
Similar to dpkg-preconfigure.