Elektra  0.8.14
0.8.14 Release

Again we managed to release with many new features and plugins (lua, enum, list, crypto, csvstorage, conditionals, mathcheck, filecheck, logchange) many fixes, and especially with a polished documentation.

Documentation Initiative

The documentation Initiative is a huge success and now the documentation of Elektra is in a state where someone, never heard of Elektra, still can use it only by man pages.

There are now many ways to show a man page:

Help system

Nearly all README.md are now also converted to man pages and also to Doxygen.

Doxygen Filter

Kurt Micheli did an amazing work with a new doxygen filter. The filter allows all Elektra Markdown pages to be also included in the doxygen documentation. Thus all technical concepts are now explained in Markdown pages, this filter is essential.

But even more, the filter also includes all man pages written for the tools, giving a nice html view for them. (In addition to the markdown rendering on github).

A big thanks to Kurt Micheli!

Further Docu fixes

Simplicity

We shifted our http://git.libelektra.org/blob/master/doc/GOALS.md "goals" a bit: We want to prefer simplicity to flexibility. Not because we do no like flexibility, but because we think we achieved enough of it. Currently (and in future) you can use Elektra:

But we cut flexibility regarding:

Qt-gui 0.0.9

Raffael Pancheri again updated his qt-gui to version 0.0.9 (beta) with important of fixes and improvements:

A bit thanks to Raffael Pancheri!

Compatibility

As always, the API and API is fully forward-compatible, i.e. programs compiled against an older 0.8 versions of Elektra will continue to work.

The behaviour of some plugins, however, changed:

Build System

ENABLE_CXX11 does not exist anymore, it is always on. We do not care about 199711L compilers anymore, which makes development easier, without losing any actually used platform.

Some programs that are only used in-source are not installed anymore. (by Pino Toscano)

Python and Lua plugins are enabled now in -DPLUGINS=ALL.

Python3 plugin was renamed to python.

Lua Plugin

Manuel Mausz add a lightweight alternative to the python plugin: the lua plugin. In a similar way, someone can write scripts, which are executed on every access to the http://libelektra.org/blob/master/doc/help/elektra-glossary.md "key database".

To mount a lua based filter, you can use:

kdb mount file.ini /lua ini lua script=/path/to/lua/lua_filter.lua

Even though it works well, it is classified as technical preview.

Thanks to Manuel Mausz for this plugin!

Cryptography Plugin

In this technical preview, Peter Nirschl demonstrates how a plugin can encrypt Elektra's values. In testcases it is already able to do so, but for the end user an easy way for key derivation is missing.

A big thanks to Peter Nirschl!

Conditionals

Brings if inside Elektra. It lets you check if some keys have the values they should have.

    kdb mount conditionals.dump /tmount/conditionals conditionals dump
    kdb set user/tmount/conditionals/fkey 3.0
    kdb set user/tmount/conditionals/hkey hello
    kdb setmeta user/tmount/conditionals/key check/condition "(hkey == 'hello') ? (fkey == '3.0')" # success
    kdb setmeta user/tmount/conditionals/key check/condition "(hkey == 'hello') ? (fkey == '5.0')" # fail

INI Plugin

The INI plugin got a near rewrite. Now it handles many situations better, has many more options and features, including:

Thanks to Thomas Waser for this work!

List Plugin

Currently, Elektra has some limitations on how many plugins can be added to certain http://libelektra.org/blob/master/doc/help/elektra-plugins-ordering.md "placements". Because of the rapidly growing number of plugins, some combinations are not possible anymore.

This plugin tackles the issue, by delegating the work to an arbitrary number of subplugins. As a bonus, it works lazily and thus might avoid the loading of some plugins all together.

Thanks to Thomas Waser for this plugin!

Csvstorage Plugin

You can now mount csv-files. To mount test.csv simply use:

kdb mount test.csv /csv csvstorage

There are many options, e.g. changing the delimiter, use header for the key names or predefine how the columns should be named. For details see the documentation.

Thanks to Thomas Waser!

Filecheck plugin

The also new plugin lineendings is already superseded by the filecheck plugin.

Thanks to Thomas Waser!

Enum plugin

The Enum plugin checks string values of Keys by comparing it against a list of valid values.

Thanks to Thomas Waser!

Electrify Machinekit.io

We are proud that Machinekit starts using Elektra.

Alexander Rössler is digging into all details, and already enhanced the DBUS Plugin for their needs. DBus now can emit a message for every changed key.

A big thanks to Alexander Rössler!

KDB Tools:

Bugfixes

Other Gems

Get It!

You can download the release from here and now also here on github

This release tarball now is also available signed by me using gpg

already built API-Docu can be found here

Stay tuned!

Subscribe to the RSS feed to always get the release notifications.

For any questions and comments, please contact the Mailing List the issue tracker on github or by mail elekt.nosp@m.ra@m.nosp@m.arkus.nosp@m.-raa.nosp@m.b.org.

Permalink to this NEWS entry

For more information, see http://libelektra.org

Best regards, Markus

0.8.13 Release

Again we managed to release with many new features, many fixes and also other improvements.

Elektrify-getenv

getenv(3) is one of the most popular ways to retrieve configuration, even though it has many known problems:

With elektrify-getenv we wrote a solution which solves most of the problems. We use the LD_PRELOAD technique to additionally retrieve values from Elektra, and not only the environment.

You simply can do:

```bash kdb set user/env/override/HTTP_PROXY "http://my.proxy:8080" ```

This will set the HTTP_PROXY environment variable to http://my.proxy:8080. Configuration can be retrieved with kdb get:

```bash kdb get user/env/override/HTTP_PROXY lynx # or start another www-browser with the newly set HTTP_PROXY ```

Or using the man pages:

kdb elektrify-getenv man man --elektra:MANWIDTH=40

Will use MANWIDTH 40 for this invocation of man man. This feature is handy, if an option is only available by environment, but not by command-line arguments, because sometimes environment variables are not trivial to set (e.g. in Makefiles).

Some more examples:

kdb set user/env/override/MANOPT -- "--regex -LC"
kdb elektrify-getenv getenv MANOPT   # to check if it is set as expected
kdb getenv MANOPT   # if /etc/ld.so.preload is active

So is this the final solution for configuration and manual elektrification of applications is not needed anymore?

The answer is: no and yes.

It is quite satisfactory for configuration that is inherently sharable (not different from one application to another) and needs the environment semantics, i.e. some subprocesses should have different configuration than others, e.g. in a specific terminal.

But it might not be a good solution for your own application, because libgetenv(3) implies many architectural decision, that other elektrified applications would decide differently, e.g.:

For more information see http://git.libelektra.org/blob/master/src/libgetenv/README.md "src/libgetenv/README.md"

Compatibility

As always, the API and API is fully forward-compatible, i.e. programs compiled against an older 0.8 versions of Elektra will continue to work.

Because keyUnescapedName and keyGetUnescapedNameSize is added in this release, it is not backward-compatible, i.e. programs compiled against 0.8.13, might not work with older 0.8 libraries.

The function keyUnescapedName provides access to an unescaped name, i.e. one where / and \\ are literal symbols and do not have any special meaning. NULL characters are used as path separators. This function makes it trivial and efficient to iterate over all path names, as already exploited in all bindings:

Other small changes/additions in bindings:

Doxygen 1.8.8 is preferred and the configfile was updated to this version.

The symbols of nickel (for the ni plugin) do not longer leak from the Elektra library. As such, old versions of testmod_ni won't work with Elektra 0.8.13. A version-script is now in use to only export following symbols:

In this release, ENABLE_CXX11 was changed to ON by default.

Note that in the next release 0.8.14 there will be two changes:

By not having to care for pre-C++11 compilers, we hope to attract more developers. The core part is still in C99 so that Elektra can be used on systems where libc++ is not available. Many new plugins are still written in C99, also with the purpose of not depending on C++.

Python Plugins

A technical preview of python3 and python2 plugins has been added.

With them its possible to write any plugin with python scripts.

Note, they are a technical preview. They might have severe bugs and the API might change in the future. Nevertheless, it is already possible to, e.g. develop storage plugins with it.

They are not included in ALL plugins. To use it, you have to specify it:

-PLUGINS="ALL;python;python2"

Thanks to Manuel Mausz for to this work on the plugins and the patience in all the last minute fixes!

Qt-gui 0.0.8

The GUI was improved and the most annoying bugs are fixed:

A big thanks to Raffael Pancheri!

KDB Tool

The commandline tool kdb also got some improvements. Most noteworthy is that kdb get -v now gives a complete trace for every key that was tried. This is very handy if you have a complex specification with many fallback and override links.

It also shows default values and warnings in the case of context-oriented features.

Furthermore:

Documentation Initiative

As Michael Haberler from machinekit pointed out it was certainly not easy for someone to get started with Elektra. With the documentation initiative we are going to change that.

Any further help is very welcome! This call is especially addressed to beginners in Elektra because they obviously know best which documentation is lacking and what they would need.

Portability

kdb-full and kdb-static work fine now for Windows 64bit, thanks to Manuel Mausz. The wresolver is now more relaxed with unset environment.

All issues for Mac OS X were resolved. With the exception of elektrify-getenv everything should work now, thanks to Mihael Pranjic:

and thanks to Daniel Bugl:

furthermore:

Thanks to Manuel Mausz for to testing and improving portability!

Packaging and Build System

Further Fixes

Notes

There are some misconceptions about Elektra and semi structured data (like XML, JSON). Elektra is a key/value storage, that internally represents everything with key and values. Even though, Elektra can use XML and JSON files elegantly, there are limitations what XML and JSON can represent. XML, e.g., cannot have holes within its structure, while this is obviously easily possible with key/value. And JSON, e.g., cannot have non-array entries within an array. This is a more general issue of that configuration files in general are constrained in what they are able to express. The solution to this problem is validation, i.e. keys that does not fit in the underlying format are rejected. Note there is no issue the other way round: special characteristics of configuration files can always be captured in Elektra's metadata.

Get It!

You can download the release from here and now also here on github

This release tarball now is also available signed by me using gpg

already built API-Docu can be found here

Stay tuned!

Subscribe to the RSS feed to always get the release notifications.

For any questions and comments, please contact the Mailing List the issue tracker on github or by mail elekt.nosp@m.ra@m.nosp@m.arkus.nosp@m.-raa.nosp@m.b.org.

Permalink to this NEWS entry

For more information, see http://libelektra.org

Best regards, Markus

0.8.12 Release

Again we managed to release with new features, many build system fixes and also other improvements.

dir namespace

This namespace adds per-project or per-directory (hence the name) configurations. E.g. think how git works: not only /etc and ~ are relevant sources for configuration but also the nearest .git directory.

This technique is, however, much more widely useful than just for git repositories! Nearly every application can benefit from such a per-dir configuration. Its almost certain that you have already run into the problem that different projects have different guidelines (e.g. coding conventions, languages, whitespace requirements, line breaks, ..). Obviously, thats not a per-user configuration and its also not a per-file issue (thats how its usually solved today). So in fact you want, e.g., your editor to have an additional per-project layer to choose between such settings.

The technique is useful for nearly every other tool:

It is simple to use, also for the administrative side. First, change to the folder to your folder (e.g. where a project is):

cd ~/projects/abc

Then add some user (or system or spec) configuration to have some default.

kdb set user/sw/editor/textwidth 72

Then verify that we get this value back when we do a cascading lookup:

kdb get /sw/editor/textwidth

The default configuration file for the dir-namespace is pwd/KDB_DB_DIR/filename:

kdb file dir/sw/editor/textwidth

We assume, that the project abc has the policy to use textwidth 120, so we change the dir-configuration:

kdb set dir/sw/editor/textwidth 120

Now we will get the value 120 in the folder ~/projects/abc and its subdirectories (!), but everywhere else we still get 72:

kdb get /sw/editor/textwidth

Obviously, that does not only work with kdb, but with every elektrified tool.

mount files in dir namespaces

For cascading mountpoints, the dir name is also automatically mounted, e.g.:

kdb mount editor.ini /sw/editor ini

But its also possible to only mount for the namespace dir if no cascading mountpoint is present already:

kdb mount app.ini dir/sw/app tcl

In both cases keys below dir/sw/editor would be in the INI file .dir/editor.ini and not in the file .dir/default.ecf.

dir together with spec namespace

In the project P we had the following issue: We needed on a specific computer the configuration in /etc to be used in favour of the dir config.

We could easily solve the problem using the specification:

kdb setmeta spec/sw/P/current/org/base override/#0 /sw/P/override/org/base

Hence, we could create system/sw/P/override/org/base which would be in favour of dir/sw/P/current/org/base. So we get system/sw/P/override/org/base when we do:

kdb get /sw/P/current/org/base

Alternatively, one could also use the specification:

kdb setmeta spec/sw/P/current/org/base namespace/#0 user
kdb setmeta spec/sw/P/current/org/base namespace/#1 system
kdb setmeta spec/sw/P/current/org/base namespace/#2 dir

Which makes dir the namespace with the least priority and system would be preferred. This was less suitable for our purpose, because we needed the override only on one computer. For all other computers we wanted dir to be preferred with only one specification.

Conclusion

The great thing is, that every elektrified application, automatically gets all the mentioned features. Not even a recompilation of the application is necessary.

Especially the specification provides flexibility not present in other configuration systems.

Qt-Gui 0.0.7

Raffael Pancheri again did a lot of stabilizing work:

The GUI can be handy for many purposes, e.g. we use it already as xml and json editor. Note that there are still some bugs.

Other fixes

Compatibility

As always, the API and API is fully compatible. Because nothing was added, its even possible to link against an older version of Elektra (if compiled against 0.8.12).

In plugins some small changes may effect compatibility:

These two points are also the only unit tests that fail when Elektra 0.8.12 is used with 0.8.11 unit tests.

Build Server

Get It!

You can download the release from here and now also here on github

This release tarball now is also available signed by me using gpg

already built API-Docu can be found here

Stay tuned!

Subscribe to the RSS feed to always get the release notifications.

For any questions and comments, please contact the Mailing List the issue tracker on github or by mail elekt.nosp@m.ra@m.nosp@m.arkus.nosp@m.-raa.nosp@m.b.org.

Permalink to this NEWS entry

For more information, see http://libelektra.org

Best regards, Markus

0.8.11 Release

From the beginning of the Elektra Initiative, Elektra aimed at avoiding hard-coded information in the application and to make the application's configuration more transparent. While avoiding any pathes to files was reality from the first released Elektra version, now also hard-coding default values, fallback mechanisms and even Elektra's pathes to keys can be avoided.

How does that work?

Elektra 0.8.11 introduces a so called specification for the application's configuration. It is located below its own namespace spec (next to user and system).

Once the base path is known, the user can find out all Elektra pathes used by an application, using:

kdb ls spec/basepath

Keys in spec allow us to specify which keys are read by the application, which fallback it might have and which is the default value using meta data. The implementation of these features happened in ksLookup. When cascading keys (those starting with /) are used following features are now available (in the meta data of respective spec-keys):

This technique does not only give you the obvious advantages, but also provides complete transparency how a program will fetch a configuration value. In practice that means that:

kdb get "/sw/app/#0/promise"

will give you the exact same value as the application uses when it lookups the key promise. Many ifs and hardcoded values are avoided, we simply fetch and lookup the configuration by following code:

Key *parentKey = keyNew("/sw/app/#0", KEY_CASCADING_NAME, KEY_END);
kdbGet(kdb, ks, parentKey);

ksLookupByName(ks, "/sw/app/#0/promise", 0);

We see in that example that only Elektra pathes are hardcoded in the application. But those can be found out easily, completely without looking in the source code. The technique is simple: append a logger plugin and the KDB base path is printed to:

What we do not see in the program above are the default values and fallbacks. They are only present in the so specification (namespace spec). Luckily, the specification are key/value pairs, too. So we do not have to learn something new, e.g. using the ni plugin we can specify:

[promise]
default=20
fallback/#0=/somewhere/else
namespace/#0=user

1.) When this file is mounted to spec/sw/app/#0 we specify, that for the key /sw/app/#0/promise only the namespace user should be used. 2.) If this key was not found, but /somewhere/else is present, we will use this key instead. The fallback technique is very powerful: it allows us to have (recursive) links between applications. In the example above, the application is tricked in receiving e.g. the key user/somewhere/else when promise was not available. 3.) The value 20 will be used as default, even if no configuration file is found.

Note that the fallback, override and cascading works on key level, and not like most other systems have implemented, on configuration file level.

Namespaces

The specification gives the namespaces clearer semantics and purpose. Key names starting with a namespace are connected to a configuration source. E.g. keys starting with:

When a key name starts with an / it means that it is looked up by specification. Such a cascading key is not really present in the keyset (except when a default value was found). They are neither received nor stored by kdbGet and kdbSet.

Applications shall only lookup using cascading keys (starting with /). If no specification is present, cascading of all namespaces is used as before.

Elektra will (always) continue to work for applications that do not have a specification. We strongly encourage you, however, to write such a specification, because:

For a tutorial how to actually elektrify an application and for more background to Elektra, https://github.com/ElektraInitiative/libelektra/blob/master/doc/tutorials/application-integration.md "read this document".

For a full list of proposed and implemented meta-data, https://github.com/ElektraInitiative/libelektra/blob/master/doc/NAMESPACES.md "read this document".

Simplification in the merging framework

As it turned out the concept of very granular merge strategies was hard to understand for users of the three-way merging framework that emerged in the last year's GSoC. While this granularity is desirable for flexibility, we additionally wanted something easy to use. For that reason merge configurations were introduced. These are simply preconfigured configurations for a merger that arrange required strategies for the most common merging scenarios. Especially they make sure that meta merging is handled correctly.

Have a look at the changes in the example src/libtools/examples/merging.cpp for an glimpse of the simplifications.

A big thanks to Felix Berlakovich!

The header files will be installed to /usr/include/elektra/merging, but they are subject to be changed in the future (e.g. as they did in this release).

From the merging improvements some minor incompatibility happened in kdb import. Not all merging strategies that worked in 0.8.10 work anymore. Luckily, now its much simpler to choose the strategies.

API

The main API kdb.h has two added lines. First a new method was added:

ssize_t keyAddName(Key *key, const char *addName);

This method is already used heavily in many parts. Contrary to keySetBaseName and keyAddBaseName it allows us to extend the path with more than one Element at once, i.e. / are not escaped.

The other new line is the new enum value KEY_FLAGS. This feature allows bindings to use any flags in keyNew without actually building up variable argument lists. (Thanks to Manuel Mausz)

As always, API+ABI is stable and compatible.

Proposed

Many new functions are proposed and can be found in the doxygen docu and in kdbproposal.h.

Noteworthy is the method keyGetNamespace which allows us to query all namespaces. Since this release we changed every occurrence of namespaces (except documentation) with switch-statements around keyGetNamespace. This allows us to add new more namespaces more easily. (Although its currently not planned to add further namespaces.)

Finally, a bunch of new lookup options were added, which might not be useful for the public API (they allow us to disable the specification-aware features mentioned in the beginning).

Obsolete and removed concepts

umount

The concept that backends have a name (other than their mountpoint) is now gone. Backends will simply be named with their escaped mountpath below system/elektra/mountpoints without any confusing additional name.

Unmounting still works with the mountpath.

Removing this concept makes Elektra easier to understand and it also removes some bugs. E.g. having mountpoints which do not differ except having a _ instead of a / would have caused problems with the automatic name generation of Elektra 0.8.10.

Old mountpoints need to be removed with their 0.8.10 name (_ instead of /).

directory keys

Additionally, the so called directory keys were also removed. Elektra was and still is completely key/value based. The / separator is only used for mountpoints.

fstab

The plugin fstab is also improved: Slashes in mountpoints are escaped properly with the internal escaping engine of keyAddBaseName() (i.e. without any problematic / replacements).

dirname

getDirName() was removed from C++, gi-lua, gi-python2, gi-python3, swig-lua, swig-python2 and swig-python3. It was never present in C and did not fit well with keyBaseName() (which returns an unescaped name, which is not possible for the dirname). (Thanks to Manuel Mausz)

invalid parent names

While empty (=invalid) names are still accepted as parentName to kdbGet and kdbSet for compatibility reasons, but the parentKey

Key *parentKey = keyNew("/", KEY_END);

should be used instead (if you want to get or store everything). They have identical behaviour, except that invalid names (that cannot be distinguished from empty names) will produce a warning. In the next major version invalid parentNames will produce an error.

KDB Behaviour

It is now enforced that before a kdbSet() on a specific path a kdbGet() on that path needs to be done. This was always documented that way and is the only way to correctly detect conflicts, updates and missing configuration files. Error #107 will be reported on violations.

Additionally, the handling with missing files was improved. Empty keysets for a mountpoint now will remove a file. Such an empty file is always up-to-date. Removing files has the same atomicity guarantees as other operations.

The concurrency behaviour is at a very high level: as expected many processes with many threads can each concurrently write to the key database, without any inconsistent states: This is noted here because Elektra works on standard configuration files without any guarding processes.

Filesystem problems, e.g. permission, now always lead to the same errors (#9, #75, #109, #110), regardless of the storage plugin.

Qt-Gui 0.0.6

Raffael Pancheri was very busy and did a lot of stabilizing work:

The gui is already used and the remaining small bugs (see github) are going to be fixed soon. One of the highlights is undo for nearly every action, so nothing prevents you from trying it out!

A huge thanks to Raffael Pancheri for his contributions. His thesis can be found at here.

Bug fixing

Further gems

Further Notes

With 471 files changed, 27978 insertions(+), 11512 deletions(-) this release is huge. With 773 commits over four month much more changes happened which did not find their place in these release notes, even though the notes are much less detailed than usual.

Thanks for all contributions that are not enlisted here!

For any questions and comments, please contact the Mailing List or elekt.nosp@m.ra@m.nosp@m.arkus.nosp@m.-raa.nosp@m.b.org.

Get It!

You can download the release from here

This release tarball now is also available signed by me using gpg

already built API-Docu can be found here

Stay tuned!

Subscribe to the new RSS feed to always get the release notifications.

Permalink to this NEWS entry

For more information, see http://www.libelektra.org

Best regards, Markus

0.8.10 Release

Hello,

we are delighted to announce our latest feature release providing major updates in:

XDG Compatibility

Elektra now is fully XDG 0.8 compliant. Following changes were necessary:

For example, we could use resolver_fm_xhp_x:

kdb mount --resolver=resolver_fm_xhp_x file.dump /example dump
kdb file user/example
kdb file system/example

Will show you that for both user+system the resolver respects XDG environment variables, e.g. above lines will print:

/home/m/.config/file.dump
/etc/xdg/file.dump

Of course, any attempts to get and set keys below user/example and system/example will also be in these files.

The letters after _ describe the variant of the resolver:

A lot of such resolver variants are added when -DPLUGINS=ALL is used. Of course you can create new variants with different behaviour by adding them to PLUGINS.

To make your application (that uses Elektra) XDG aware, you have nothing to do: you get it to free. Make sure to always use cascading lookup. Additionally, an XDG conforming application should not write system/ keys.

OpenICC Compatibility

Based on that, Elektra now also implements the draft for the OpenICC specification.

The mount command looks like quite complicated, but it consists of simple parts:

kdb mount --resolver=resolver_fm_xhp_x \
  color/settings/openicc-devices.json /org/freedesktop/openicc \
  yajl rename cut=org/freedesktop/openicc

We already know the first two lines: we use the XDG resolver already introduced above. Only the file name and the path where it should be mounted differs.

The plugin yajl is a storage plugin that reads/writes json. The plugin rename was the missing link to support OpenICC (thanks to Felix Berlakovich for closing this gap). It is needed, because every OpenICC file starts like this:

{ "org": { "freedesktop": { "openicc": {

Because the backend is mounted at /org/freedesktop/openicc, it would lead to keys below /org/freedesktop/openicc/org/freedesktop/openicc which we obviously do not want. So we simply get rid of the common prefix by cutting it out using the rename plugin.

Of course this renaming functionality can be used in every situation and is not limited to OpenICC.

Tools

A large number of old and new tools were added, mostly for convenience e.g.:

kdb mount-openicc

saves you from writing the long mount command we had in the previous section.

To get a list of all tools that are installed, now the command (which is also an external tool and as such currently not displayed in kdb –help):

kdb list-tools

is available. Do not be surprised: on typical installations this will be a large list. You can run each of these tools by using kdb <command>. Most of the tools, however, are part of the test suite, which you can run using:

kdb run_all

Other tools are "old friends", e.g. convert-fstab written in 2006 by Avi Alkalay still works:

kdb convert-fstab | kdb import system/filesystems xmltool

It will parse your /etc/fstab and generate a XML. This XML then can be imported. Other convert tools directly produce kdb commands, though.

kdb now uses KDB itself for many commands:

By default the plugin "sync" is added automatically (it makes sure that fsync is executed on config files, the directory is already done by the resolver), you should not remove it from /sw/kdb/current/plugins otherwise the next mount command will not add it. To preserve it use a space separated list, e.g.:

kdb set user/sw/kdb/current/plugins "sync syslog"

Last, but not least, kdb get now supports cascading get:

kdb get /sw/kdb/current/plugins

This feature allows you to see the configuration exactly as seen by the application.

Other options:

Compatibility

The core API (kdb.h), as always, stayed API/ABI compatible. The only changes in kdb.h is the addition of KEY_CASCADING_NAME and KEY_META_NAME. So applications compiled against 0.8.10 and using these constants, will not work with Elektra 0.8.9.

The constants allow us to create following kinds of keys:

Usage in C is:

Key *c = keyNew("/org/freedesktop", KEY_CASCADING_NAME, KEY_END);
Key *m = keyNew("comment/#0", KEY_META_NAME, KEY_END);

The same functionality exists, of course, in available in all bindings, too.

Changes in non-core API are:

CMake

It is now possible to remove a plugin/binding/tools by prefixing a name with "-". The new "-element" syntax is accepted by TOOLS, BINDINGS and PLUGINS. It is very handy in combination with ALL, e.g.:

-DPLUGINS="ALL;-xmltool"

will include all plugins except xmltool.

Improved comments

Comment preserving was improved a lot. Especially, the hosts plugin was rewritten completely. Now multiple different comment styles can be intermixed without losing information. E.g. some INI formats support both ; and # for comments. With the new comments it is possible to preserve that information and even better: applications can iterate over that information (meta data).

To mount the new hosts plugin use (if you already have mounted it, you have nothing to do):

kdb mount /etc/hosts system/hosts hosts

The hosts plugin now seperates from ipv4 and ipv6 which makes the host names canonical again, e.g.:

kdb get system/hosts/ipv4/localhost
kdb get system/hosts/ipv6/localhost

To access the inline-comment, use:

kdb getmeta system/hosts/ipv4/localhost "comment/#0"

For other meta information, see:

kdb lsmeta system/hosts/ipv4/localhost 

Additionally, a small API for specific meta-data operations emerges. These operations will be moved to a separate library and will not stay in Elektra's core library.

Proposal

Java binding

Elektra now fully supports applications written in Java and also Plugins written in the same language.

The new binding was developed using jna. For the plugin interface JNI was used. We developed already some plugins.

Qt-Gui

Raffael Pancheri released the version 0.0.2 of the Qt-Gui:

Further stuff and small fixes

Get It!

You can download the release from here

already built API-Docu can be found here

Stay tuned!

Subscribe to the new RSS feed to always get the release notifications.

Permalink to this NEWS entry

For more information, see http://www.libelektra.org

Best regards, Markus

0.8.9 Release

Again we managed to do an amazing feature release in just two month. In 416 commits we modified 393 files with 23462 insertions(+) and 9046 deletions(-).

Most awaited

The most awaited feature in this release is certainly the qt-gui developed by Raffael Pancheri. It includes a rich feature set including searching, unmounting, importing and exporting. A lot of functionality is quite stable now, even though its version is 0.0.1 alpha. If you find any bugs or want to give general feedback, feel free to use the issue tracker of the Elektra project. A screenshot can be found here To compile it (together with Elektra), see the README here

Manuel Mausz also has been very active and developed glib+gi bindings. These bindings make Elektra more friendly to the glib/gtk/gnome world. Using the gobject introspection python3 and lua bindings were developed. Additionally he got rid of all clang warnings.

Felix Berlakovich also made progress: the ini plugin now supports multiline and which can be dynamically turned on and off, i.e. during mounting (thanks to Felix)

Last, but not least, Kai-Uwe ported Elektra to Windows7. MinGW is now one more supported compiler (tested on build-server, see later). Astonishingly, it was only little effort necessary: Basically we only needed a new implementation of the resolver, which is now called wresolver. Different from the resolver it lacks the sophisticated multi-process and multi-thread atomicity properties. On the plus side we now have a resolver that is very easy to study and understand and still works as file resolver (noresolver does not).

Interfaces

ABI/API of the C-API is still completely stable even though under the hood a lot was changed. All testcases compiled against the previous version still run against Elektra 0.8.9.

This is, however, not the case for libtools. For MinGW porting it was necessary to rename an enum related to merging because it conflicted with an already defined MACRO.

For maintainers also some changes are necessary. For MinGW and to actually use the flexibility of the new resolver variants two new CMake Variables are introduced: KDB_DEFAULT_RESOLVER and KDB_DEFAULT_STORAGE.

More importantly for maintainers the CMake variables regarding SWIG bindings are now abandoned in favour to the new variable BINDINGS that works like PLUGINS and TOOLS. Just start with

    -DBINDINGS=ALL

and CMake should remove the bindings that have missing dependencies on your system. Remember that glib and gi (i.e. gi_python3 and gi_lua) bindings were introduced, too. Additionally, the cpp binding can now be deactivated if not added to BINDINGS.

Finally, the gen tool added a Python package called support.

Other Bits

A proof of concept storage plugin regexstore was added. It allows one to capture individual configuration options within an otherwise not understood configuration file (e.g. for vimrc or emacs where the configuration file may contain programming constructs).

Most tests now also work with the BUILD_SHARED variant (from our knowledge all would work now, but some are still excluded if BUILD_FULL and BUILD_STATIC is disabled. Please report issues if you want to use uncommon CMake combinations).

A small but very important step towards specifying configuration files is the new proposed API method ksLookupBySpec (and ksLookup implementing cascading search). It introduces a logical view of configuration that in difference to the physical view of configuration does not have namespaces, but everything is below the root "/". Additionally, contextual values now allow to be compile-time configured using C++-Policies. These are small puzzle pieces that will fit into a greater picture at a later time.

A (data) race detection tool was implemented. Using it a configurable number of processes and threads it tries to kdbSet() a different configuration at (nearly) the same time.

With this tool the resolver could be greatly be improved (again). It now uses stat with nanosecond precision that will be updated for every successful kdbSet(). Even if the configuration file was modified manually (not using Elektra) the next kdbSet() then is much more likely to fail. Additionally a recursive mutex now protects the file locking mechanism.

The build server now additionally has following build jobs:

Many more examples were written and are used within doxygen. Most snippets now can also be found in compilable files:

Most plugins now internally use the same CMake function add_plugin which makes plugin handling more consistent.

Felix converted the METADATA spec to ini files and added a proposal how comments can be improved.

Refactoring:

Optimization:

Fixes:

Get It!

You can download the release from here

already built API-Docu can be found here

For more information, see http://www.libelektra.org

Best regards, Markus

0.8.8 Release

In this release we changed 578 files in 473 commits (68596 insertions(+), 59260 deletions(-) compared to Elektra 0.8.7). We assume thats the largest change set for any of Elektra's releases up to now. It happened only within a bit more than a month up (0.8.7 was released 28.07.2014).

New features

GSoC finished successfully (thanks Ian and Felix) See http://community.libelektra.org/wp for the latest results. So Elektra now has a 3-way merging framework that is superior to text-based merging in many scenarios (e.g. moving configuration options within a file or with in-line comments) iff a storage plugin creates key names that are not only line numbers. We love to get Feedback!

Writing plugins is now even more comfortable. A plugin writer tutorial was written (thanks Ian): https://github.com/ElektraInitiative/libelektra/blob/master/doc/tutorials/plugins.md The documentation was completely reworked: http://doc.libelektra.org/api/0.8.7/html/group__plugin.html And two new macros allow printf formating for warnings and errors (ELEKTRA_ADD_WARNINGF and ELEKTRA_SET_ERRORF).

The ini plugin was greatly improved (tested with samba configurations and added to ALL plugins) and the hosts plugin was rewritten to support ipv6 properly (thanks to Felix).

The constants plugin was added and allows introspection of Elektra's cmake variables. Because such non-file based plugins (e.g. also uname) do not need resolving, the plugin noresolver was added. It supersedes the success plugin.

Elektra now allows one to correctly fsync its configuration files (sync plugin) and the folders where files are stored (resolver plugin). Just make sure to add the "sync" plugin using kdb mount. The resolver plugin now reads from passwd and no longer needs environment variables. Additionally, the resolver plugin was prepared to support other variants by so called compilation variants.

The error plugin now allows, next to list all possible errors, to provoke errors when opening plugins. We fixed some issues related to plugins having errors when they initialize themselves.

So following plugins were added: sync noresolver line ini constants Nearly all plugins now have a README.md for further information (thanks to Ian). An overview of all plugin is on with links to them: https://github.com/ElektraInitiative/libelektra/blob/master/src/plugins/

The kdb tools were greatly improved (thanks to Felix):

New/improved scripts/make targets (note that scripts can be executed by kdb scriptname):

Compatibility

This time we had to break compatibility. We did not change the ABI (your application still will be able to use Elektra 0.8.8) and we did not change the API (your application still will compile against Elektra). We changed the third part of our interface: the semantic interface.

The problems were following: keyAddBaseName/keySetBaseName did something obvious when no special characters were in the baseName. But once there were, there are two different interpretations what it should do: 1.) add/set a basename, so escape characters that are not canonical in the basename 2.) add all parts of the name given (with slashes)

The methods were used in both ways, so it was obvious that something is very wrong. We decided that it should do what the name says, that is add/set a basename (variant 1).

The variant 2, to add any name was added and is called keyAddName() and added as proposal.

(Thank Felix for implementations and Manuel for investigations)

When keys are renamed after adding to a keyset is a bad thing because it destroys the order of the keyset. This is now avoided by keyLock. Use keyDup() to get rid of such locks.

Another, even larger, change is also about ordering of keys in keysets. Elektra now internally has an null-terminated unescaped keyname. Ordering of keysets will always happen on this name. The keyCmp() tool can be used to check this order. It works very efficiently with memcmp() and never gets confused by ASCII ordering of / (because / is 0 in the unescaped keyname).

The syntax, semantics and conventions of key names is now documented in detail: http://doc.libelektra.org/api/0.8.8/html/group__keyname.html

ksNew() does now return a keyset with a properly set cursor (ksRewind).

Because its always possible that software relies on bugs the better way to deal with such a situation (as the keySetBaseName() situation described above) is to provide the same function twice. Manuel said he will create a prototype to introduce symbol versioning in Elektra. With that, old customers would still receive the old behaviour, but people compiling against a new version would get the new behaviour. So in one of the next releases we will also avoid semantic interface changes when there is a valid use case for it (there is none if the program e.g. crashes).

Symbol versioning also allows one to compile against old versions on purpose if you do not want the new behaviour.

We have prepared an ABI-test suite, that also checks behaviour, for that purpose, but we also improved testing in other parts:

If you try to execute test_ks from 0.8.7 with libelektra 0.8.8 it will crash, but not because of any incompatibility, but because of strcmp in the test itself gets a null pointer. The pointer is now null, because ksNew correctly rewinds its internal cursor (see above). Amusingly, it says on that line 94 in test_ks.c: // TODO: why is the cursor here?

API Proposals

see above for more information:

some new ideas:

elektraArrayIncName() now works correctly with empty arrays embedded in other arrays (yajl+line plugin)

elektraArrayValidateName() was also added, thanks to Felix.

These methods are declared in the file kdbproposal.h but do not guarantee any forms of compatibility (they might even be removed).

Issues

Many issues were resolved as you can see in github: https://github.com/ElektraInitiative/libelektra/issues Alone for the milestone 0.8.8 we closed 17 issues, including those mentioned in "Compatibility". Other issues (not all were tracked on github):

Other Stuff

Thanks to Pino Toscano Elektra 0.8.7-4 is now available in Debian Testing: https://packages.debian.org/search?keywords=elektra So it is only a matter of time that other (debian-based) distributions will follow and replace the dusty Elektra 0.7.

Debian Continuous Integration http://ci.debian.net/packages/e/elektra (thanks Pino) greatly complement our tests running on http://build.libelektra.org:8080/

Elektra's buildserver also was improved:

Raffael Pancheri now made a merge request for qt-gui https://github.com/ElektraInitiative/libelektra/pull/103/files in which copy, paste and delete of keys already works. It is, however, still work in progress.

Manuel Mausz made great progress in script-based Elektra plugins. He is also working on glib+gobject-introspection based bindings. He investigated some issues, e.g. a crash of the python binding which was only triggered if python3 is build with a specific flag/module combination, see: https://github.com/ElektraInitiative/libelektra/issues/25

Get It!

You can download the release from:

http://www.markus-raab.org/ftp/elektra/releases/elektra-0.8.8.tar.gz

already built API-Docu can be found here:

http://doc.libelektra.org/api/0.8.8/html/

Best regards, Markus