From 933e302678259a5502040f9c457d74a7f21b3faa Mon Sep 17 00:00:00 2001 From: Markus Raab Date: Sun, 11 Dec 2016 15:34:12 +0100 Subject: [PATCH] augeas: also add provides to variants --- doc/decisions/plugin_variants.md | 6 ++---- src/plugins/augeas/augeas.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/decisions/plugin_variants.md b/doc/decisions/plugin_variants.md index 8e57ec767e8..7989dc89eaa 100644 --- a/doc/decisions/plugin_variants.md +++ b/doc/decisions/plugin_variants.md @@ -76,13 +76,12 @@ system/access system/access/config system/access/config/lens = Access.lns system/access/infos -system/access/infos/format = access +system/access/infos/provides = storage/access system/aliases system/aliases/config system/aliases/config/lens = Aliases.lns -system/aliases/config/path = /etc/aliases system/aliases/infos -system/aliases/infos/format = aliases +system/aliases/infos/provides = storage/aliases ``` `genconf` for python might yield: @@ -134,7 +133,6 @@ system/elektra/plugins/variants/simpleinis/config/format = "% %" - `PluginDatabase` needs an extension to list all plugin variants - `kdb list` should be able to list all variants, e.g. like: `augeas lens=Access.lns` - `augeas format=access` so that a user can copy and paste this for the `kdb mount` command. diff --git a/src/plugins/augeas/augeas.c b/src/plugins/augeas/augeas.c index 9cfbf0cc90e..7ec32878507 100644 --- a/src/plugins/augeas/augeas.c +++ b/src/plugins/augeas/augeas.c @@ -90,6 +90,16 @@ int elektraAugeasGenConf (KeySet * ks, Key * errorKey ELEKTRA_UNUSED) Key * k = keyNew ("system/", KEY_END); keyAddBaseName (k, p); ksAppendKey (ks, keyDup (k)); + + Key * b = keyDup(k); + keyAddBaseName (b, "infos"); + ksAppendKey (ks, keyDup (b)); + keyAddBaseName (b, "provides"); + char * s = elektraFormat ("storage/%s", p); + keySetString (b, s); + elektraFree (s); + ksAppendKey (ks, b); + keyAddBaseName (k, "config"); ksAppendKey (ks, keyDup (k)); keyAddBaseName (k, "lens");