This my regular weekly post on my GSoC project. Even though this week I had to give my last exams for my bachelor degree and some days of the week I had to spent them on reading, I did some progress on the actual project. First of all, I created my first patch for Augeas, yes this is my first patch not for this particular project, but in general. Every week I found my self, reading learning and carrying out new things, this is the coolest and most exciting thing in the GSoC experience until now.
Back to the actual patch, below you can see the description of the patch:
Subject: [PATCH] Added aug_find_lense function to find and return used for loading a
Aug_find_lense is a function that accepts a path of a file, and tries to
find the lense that was used to load this file in Augeas. Returns either
a string representing the lense if it is located succesfully either null
if the lense could not be found, or the file is not loaded in augeas.
As i had told you before, i am working on a merge method for augtool as well. This command works like this,
merge destination merging-parameters files-to-be-merged
merge /etc/hosts/ (merging-parameters) /tmp/myfile1 /tmp/myfile2 ….. /tmp/myfile3
Until now I am able to use the aug_find lense to locate the lense used for the destination file. Then i have implemented an extra function that can use the name of the lense to load the files-to-merged to augeas. This permits me to have all these files in tree form used by Augeas. The plan now is to finish the code with aug_process_tree function that will try to match the destination with the files-to-be-merged, and will then call the right function according to merging-parameters if a match is found.
What is next?
By having a merge command in augtool, that can load files in the way I mentioned above, i now have a test basis that will permit me to implement and test the merging functions. This must be done in the next two weeks, so i can be in the initial schedule. I am quite optimistic, things will go as planned. This week among with the coding there has been quite a lot of research on tree pattern matching algoriths, I am grateful that there are always nice people in open source communities that provide help and tips. I am back to coding… 🙂
 Work in Progress – The aug_process_tree function will be like: int aug_process_trees(struct augeas *aug, const char *dest, void (*process)(struct augeas *aug, const char *first, const char *second, void* data), void* data,const char *sources,…);