Ian Donnelly: The Line Plug-In
Hi Everybody,
As you may have noticed I wrote a new plug-in for Elektra called line . I used it for a lot of examples in my tutorial, How-To: Write a Plug-In. The line plug-in is a very simple storage plug-in for Elektra. This plug-in stores files into the Elektra Key Database creating a new Key for each line and setting the string value of the Key to the string value of the line of that file. So if we have a file called hello.txt :
And we mount it to kdb like so:
With the getString values of
Ian S. Donnelly
Hello
World!
And we mount it to kdb like so:
kdb mount ~/line.txt system/hello_line line. The output of kdb ls system/hello_line the output would be:
system/hello_line/#1
system/hello_line/#2
With the getString values of
#1 and #2 being Hello and World! respectively. If this seems like a very simple plug-in, that s because it is. Obviously, this plug-in isn t a great showcase for the robustness of Elektra, any data structure could store a file line by line relatively easy, so why did we add a line plug-in at all?
The answer is that we included a line plug-in to allow any line-based file to use functions of Elektra, particularly the new Merge function. My Google Summer of Code project is to allow for automatic three-way merge of Debian conffiles during package upgrades as opposed to the current prompt and manual merging a user must do if a conffile is edited. Using Elektra and the new mergecode we can mount a conffile with the best plug-in for it, (the ini plug-in for Samba s smb.conf for instance) and that allows for a very powerful merging ability with a lot more success than a simple diff merge. However, there are a lot of conffiles that don t use any particular standard (such as ini, xml, or JSON) to store data. That is where the line plug-in comes in. We can still mount these files using the line plug-in and attempt a merge. Of course it is much more likely to have conflicts, and this type of merge is still susceptible to many of the same flaws as regular file merges (such as not being able to detect when a line has been moved), but it simple cases, the merge may succeed which would reduce the overall number of times a user would be prompted during an upgrade.
Basically, I wrote a line plug-in for Elektra as a fallback for conffile merges when we can t mount the conffile in any more meaningful way. While merges using KeySets that were mounted using line are more likely to fail than other, more specialized plug-ins, there are cases that these merges will succeed and the user will not have to deal with a confusing prompt. The whole point of my Google Summer of Code project is to make upgrading packages and dealing with conffiles much smoother and easier than it is now by including a three-way mere and this line plug-in will help with this goal.
Sincerely,Ian S. Donnelly














Oh man, I'm such a geek...
Being a single parent has required a considerable amount of self-discipline
on my behalf. I find I do best in an environment with routine to make sure
stuff gets done. One of the things I did to try and make sure stuff got done
was to form positive habits. To help and make this a bit more "fun", I
started using
Similarly, to query HabitRPG, I'm using:
Now maybe I'll stop dying so much in HabitRPG, my cat will have the clean
toilet she deserves, and I'll stop getting reminded about putting the
dishwasher on when I already have. Better living through automation, that's
my motto.

In the past I used to pay for an email->SMS gateway, which was used to alert me about some urgent things. That was nice because it was bi-directional, and at one point I could restart particular services via sending SMS messages.
These days I get it for free, and for my own reference here is how you get to receive free SMS alerts via Orange, which is my mobile phone company. If you don't use Orange/EE this will probably not help you.
The first step is to register an Orange email-account, which can be done here:
About torbrowser-launcher in all current Debian distros plus some thoughts and scripts for running it more securely
So,
Linkig binaries.
Having come back to old boost code that I had,
Boost binaries seem to require -lboost_system linked in.
Hmm, wonder when that started happening.
This is my monthly summary of my free software related activities. If you re among the people who