New repository configuration ponderings

Panu Matilainen pmatilai at laiskiainen.org
Tue May 30 00:13:23 PDT 2006


On Tue, 30 May 2006, Ralf Corsepius wrote:

> On Sun, 2006-05-28 at 20:47 +0300, Panu Matilainen wrote:
>> On Sun, 2006-05-28 at 19:31 +0200, Ralf Corsepius wrote:
>>> On Sun, 2006-05-28 at 20:17 +0300, Panu Matilainen wrote:
>>>> On Sun, 2006-05-28 at 18:20 +0200, Ralf Corsepius wrote:
>>>>> On Sun, 2006-05-28 at 17:33 +0300, Panu Matilainen wrote:
>>>>>> I've been thinking about improving the repository configuration and
>>>>>> related things for a while now. Just yesterday I realized we could
>>>>>> easily use the existing main configuration system for this, instead of
>>>>>> inventing yet-another-file-format and parser for it.
>>>>>
>>>>> Well, nice proposal, but ...
>>>>>
>>>>> ... wouldn't an xml config file format be more suitable?
>>>>
>>>> I *hate* XML configuration files from user POV.
>>>
>>>
>>> If xml is suitable for something, then it's parsing config files.
>>>
>>> It avoids all the kind of semifunctional implementation nonsense apt's
>>> and yum's config currently carries around, and would dramatically
>>> simplify the syntax and a parser's implementation.
>>
>> Note the "user POV" in my comment above.
> Pardon, complete rubbish, IMO.
>
> I don't see any substantially difference between
> <apt>
>  <cachedir>cache/fedora/</cachedir>
> </apt>
>
> and
>
> Apt {
>  Cache-dir { cache/fedora }
> }

Yeah, I know it's not that big a difference, but XML still gives me the 
creeps when encountered in a human editable file. And I'm not alone with 
my opinion in that.

>>  From programming point of view
>> I fully agree XML would be much nicer configuration file format. It's
>> just that XML isn't "human editable" IMO (programmers don't count as
>> humans here ;)
>
> c.f. above.
>>> But given your attitude, I withdraw my comment above. All your proposal
>>> does is adding yet another source of errors and of incompatibilities.
>>
>> Dunno, apt has a parser which does the job adequately and users are
>> already familiar with the format.
> Pardon again, IMO, a very short-sighted POV.
>
> apt currently has a swamp of key-values pairs, written in a proprietary
> block oriented language, hardly with any grammar.

...just like 99% of the existing open or closed source software out 
there :) It's just yet another bad configuration "language" among other 
things, at least I'm not inventing a new one here.

That said, there *would* be significant benefits to using XML, I'm not 
claiming anything else. What it would take IMO to switch to XML in apt 
configuration is
1) convert *all* of apt configuration to XML
2) provide basic tools for manipulating that data without having to touch 
the xml manually

It shouldn't be (too) hard to switch the tree-like main configuration to 
XML and even maintain the current API to it, which would take care of 1). 
Manipulating the data (sanely) from programs would become possible with 
XML so 2) would be much much easier to do, eg you could do
# apt-config --set some::option::here=true
and have it actually written on disk.

See, I'm not completely opposed to the XML idea ;)

 	- Panu -



More information about the Apt-Rpm mailing list