Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
augeas: also add provides to variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Raab committed Dec 11, 2016
1 parent fa8e158 commit 933e302
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 2 additions & 4 deletions doc/decisions/plugin_variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.


Expand Down
10 changes: 10 additions & 0 deletions src/plugins/augeas/augeas.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 933e302

Please sign in to comment.