«

»

Mar
31

GSoC 2011 Ideas – fillup-ng

Google Summer of Code 2011My last but not least GSoC idea. This is about actual tool that already exists but is currently a little bit broken and needs rewrite with a bigger picture in mind.

What is fillup?

As this project is named fillup-ng, it is obviously supposed to be replacement for existing utility called fillup. Let’s talk a little bit about what fillup currently does. It is used to parse sysconfig files. These files has syntax similar to shell scripts with only variables definitions. The difference is that comments in these scripts has their meaning. And fillup is used to merge them automatically somehow. Basic operation are following. You’ve got some configuration file on your system and new version cames in from package. What now? Classical solution is not to touch anything and let user resolve it manually. But fillup can do some clever things. Sometimes you want to use values specified with old configuration file and add new settings that wasn’t available in previous version. Sometimes, you want to keep only values that are in both configuration files as old configuration options are not supported anymore. It may happen that you want to replace some variables. Probably not while installing package but when running some graphical tool… If you are interested in more details, take a look at it’s man page.

All things mentioned previously can be done with fillup. So why rewriting it? It has one big design disadvantage. It operates on lines. So it can’t handle variables having values over multiple lines. And it has few other issues as well. Why not fix it? Well, sometimes it’s easier to write it from scratch than trying to fix it. And we can also add some more features! Everybody loves new features, don’t you think? Cool feature that this project will have to implement is to provide some abstraction over configuration files. Create plugin system so anybody can extend it with his own configuration file format. So fillup-ng will support multiple configuration types (at least sysconfig files and ini files), will have general API to add new plugins to handle other configuration files. These plugins will be runtime plugable (so plugin with many dependencies can be in different package). And all plugins will try to report if the input file is theirs. One more feature that would be great as we will have more configuration file is to provide list of variables that I want to filter out without specifying all variables I want to keep.

Students?

This project took longer to get students interested than most of the other projects I wrote about. But in the end I also got students wanting to work on this project. And even though it took some time before somebody got interested, now I’ve got two students interested!

4 comments

  1. Pascal Bleser says:

    Note that an implementation of such a “pluggable configuration file model” already exists: Config::Model, and already has plenty of such plugins and some tools on CPAN.

    1. Michal Hrušecký says:

      hmmm, I knew that Perl has library almost for anything :-D The goal of this project is mainly to have working replacement for fillup with additional features. Plugins are interesting feature for future extension but main goal is merging of configuration files. It will be implemented in C/C++ so no dependency on Perl. But I guess, using the libraries you mentioned and implementing it in Perl could save quite some work and make it a Hackweek project. But than we would need to implement sysconfig model anyway as I doubt that anybody else is using it ;-) Currently I still see a reasons to implement it this way but if this project wouldn’t get selected, I’ll try to take a look at it during next Hackweek (together with Perl (don’t like Perl)).

  2. Jörg Steffens says:

    another popular library that cares about generic config file handling is augeas.
    It is written in C, has binding for Ruby, Python, OCaml, Perl, Haskell, PHP, and Java.
    AFAIK it is already used by zypper (and puppet).
    It offers a view to config files as trees. Besides other formats, it already support sysconfig files (including comments)

    1. Michal Hrušecký says:

      Thanks for suggesting this. Looks like a lot of work is already done. We will definitely take a deeper look into this, looks like a reasonable plan to try to extend it to suit our needs.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>