$darkmode
Elektra 0.11.0
|
Some plugins are generic in the sense that they cannot fully define their contract statically. (Note: if they can decide it statically, you should prefer compilation variants.) Instead their contract is based on their configuration. We will call every combination of plugins+configuration, where we get a different contract plugin variant.
The current issue is that there is no way to enumerate possible plugin variants as needed to list all functionality of Elektra.
A specification of the plugin's configuration and a tool that can enumerate all possible essential configurations. Problems here are:
checkconf
(see here) approach.Implementation delayed after 1.0.
Best implementation candidate was:
int genconf (KeySet * ks, Key * errorKey)
where ks
is filled with a list of all variants with the essential configuration (subkeys config
) and the changed parts of the contract (subkeys infos
).system:/elektra/plugins/<plugin>/variants/<variantname>
have the same content, but take precedence. If a variant with the same name is defined, only config
or infos
from genconf
are considered if they are not mentioned in system:/elektra/plugins/variants
.override
(for a plugin or a variant) is true, it will be overwritten (content of genconf
ignored, but instead a plugin or variant as given is created).disable
(for a plugin or a variant) is true the plugin or a variant of the plugin will not be available.config
and infos
mean:config
: The "default variant" (without any parameter) should be also available (has useful functionality)infos
: It is not possible to determine the changes of the contract, the user need to instantiate the plugin and enquiry the contract.genconf
for augeas yields:
genconf
for python might yield:
The user:/admin specifies:
As result we get:
access
of plugin augeas
is not availablealiases
of plugin augeas
as defined from genconf
, but with changes in contract (infos/status
)configparser
of plugin python
is completely redefined (result from genconf
will not be considered) but it will be considered as specified.jni
will not be availableTo have a space-separated simpleini one would use:
genconf
API was chosen to be consistent with checkconf
. The pluginhandle might be missing for some scenarios. If it is needed, we should change both APIs for consistency reasons.genconf
needs to be implemented for the plugins:PluginDatabase
needs an extension to list all plugin variantskdb plugin-list
should be able to list all variants, e.g. like: augeas lens=Access.lns
so that a user can copy and paste this for the kdb mount
command.Currently only overrides of plugin configuration (config/...
) is possible, overrides of other plugin information (contract information) does not work yet.
It is also not possible to add additional information to a variant, only overrides work. E.g.
works, while
gets ignored.
Discussions took place here.