gpgconf: Rewrite the gpgconf-comp module.
* tools/gpgconf.h (gc_component_t): Change type to ... (gc_component_id_t): this. (GC_COMPONENT_ANY): New, so that we can use that in gpgconf-comp.c directly. * tools/gpgconf-comp.c: Major rework.
The primary reason for this rework is to support the global options.
A second reason is to clean up the code and simplify it so that we do
not anymore need to maintain a list of options in the components _and_
What we do now is to
- Read the option tables directly from the components using the new generic --dump-option-table option. This includes the header (group) descriptions.
- Read the default values from the components as before using --gpgconf-list and update gpgconf's internal tables with that info.
- Read the options using gpgrt_argparser in the same way as we do this in the components.
The changes also do away with the second level notion of backends;
they were only used for dirmngr's extra dirmngr_ldapservers.conf file.
We intend to remove that file and replace it with a regular option so
that it will be similar on how OpenPGP keyservers are specified.
The whole thing will currently be slower than before (in particular on
Windows) but we can optimize that by keeping a cached version of the
option tables and the default values in a per homedir cache file.
There is also some work planned to remove most of the data returned by
--gpgconf-list. What can also be done is to replace the internal
tables, which list the gpgconf maintainable options, by a configuration
file so that admins are able to maintain the list of these options.
This is a backport from master (2.3)
- GnuPG-bug-id: T4788
- Signed-off-by: Werner Koch <email@example.com>