debconf confusion, part XLII
[ I might have asked this before but could not find it in the
archives then ]
Every time I try use debconf in order to ease package configuration I
finally end up /not/ using it and putting extra load onto the
administrator. I don't consider debconf broken or bad, but it
constantly leaves me in the feeling some rather simple but really
helpful tools are missing.
For example: Given the (very common) situation:
1. A package, the program it provides has a configuration file, that
file should be created/altered during installation/reconfiguration.
2. The program uses the configuration file. debconf uses the debconf
database. The program however must not use the debconf database.
That's the "debconf's not a registry" mantra.
3. In "config", the script must read the configuration file (may be
missing), map the variable names to according debconf variables and
set the values in the database to ask the questions.
4. In "postinst", the script must read the debconf database and modify
the configuration file.
Both tasks 3. and 4. are error-prone, and changes require a watchful
maintainer as things have to be changed in serveral places.
Now I'm wondering why appearently nobody in the last 15 years has
missed or even created a helper program for that. It would know the
configuration file format (like "POSIX shell fragment"), has a mapping
between configuration file variables and debconf database variables
(something that could be stored in the template files), provides a
shell representation of the configuration file for step 3., and, most
important, can alter/create the configuration file as required in step
4., in a minimal-invasive, efficient and safe way. Using sed is not.
So, what misguided one am I, being probably the only one who'd consider
this a huge improvement? Or, does such a program exist but is not used
by any of the maintainer scripts I've checked?