New repository configuration ponderings

Ralf Corsepius rc040203 at freenet.de
Mon May 29 23:32:41 PDT 2006


On Sun, 2006-05-28 at 13:16 -0400, Gary L. Greene Jr. wrote:
> On Sunday 28 May 2006 01:13 pm, Ville Skyttä wrote:
> > On Sun, 2006-05-28 at 18:20 +0200, Ralf Corsepius wrote:
> > > ... wouldn't an xml config file format be more suitable?
> >
> > As long as those files need to be often directly edited by humans using
> > common plain text editors, I don't think XML is an optimal format.
> >
> > _______________________________________________
> > apt-rpm mailing list
> > apt-rpm at lists.laiskiainen.org
> > http://lists.laiskiainen.org/listinfo.cgi/apt-rpm-laiskiainen.org
> 
> Besides, mucking with xml means that a new xml parser would need written for 
> it,
Only partially correct.

One major advantage of xml over other syntaxes is xml dictating the
basic skeleton for the grammar of a language, while other languages
would have to be designed. I.e. using xml gives you less freedom in
implementing grammars and thereby reduces the risk of implementing a
fault language and to concentrate on contents.

Both apt's and yum's current "config-file file format" (config
languages) are clearly exposing this:
* Yum's configuration language applies a context sensitive, weakly
formulated grammar and doesn't have a strict syntac.
* Apt's configuration language basically is hierarchical key/value pair
lookup table, implemented in a block based grammar. This can easily be
transformed into xml.

>  etc, which is what Panu wanted to avoid according to the post that asked 
> about this.
Such a parser would be fairly straight forward, because xml almost
dictates the implementation. E.g. the key/value pair lookup current the
apt config language applies, can easily be wrapped into a XPath calls.
I.e. instead of having to implement parser trees and hash tables for
configuration lookup as part of apt, one could apply libxml's xpath
stuff.

Also, an xml-systax would allow using apt's configuration files by other
tools in arbitrary languages without having to implement other libapt
bindings. E.g. one could simply apply arbitrary XML in whatever language
you would want, be it perl, python or whatever.

Ralf






More information about the Apt-Rpm mailing list