[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: use and abuse of debconf

>>>>> "Nicolás" == Nicolás Lichtmaier <nick@debian.org> writes:

    Nicolás> <interfaces> <comment>This is a comment</comment>
    Nicolás> <auto>lo</auto> <auto>inet</auto> <auto>loopback</auto>

    Nicolás> <iface name="lo" family="inet" method="loopback"/>

    Nicolás> <iface name="eth0" family="inet" method="static">
    Nicolás> <address></address> <network></network>
    Nicolás> <netmask></netmask>
    Nicolás> <broadcast></broadcast>
    Nicolás> <gateway></gateway> </iface>

    Nicolás> </interfaces>

Thats basically what I was thinking of. I can think of some minor
improvements that bring significant advantages (for any application,
not just this one), but don't wont to side-track the issue at hand.

This means that a postinst script can call a program that parses the
file as DOM (eg. this is easy to do in Perl), modifies the elements
required, and saves the result. There is no chance of upsetting
anything else, assuming the XML format is well designed.

In addition, the script if required, can check that the file is still
valid, and nothing has been done to make a valid file invalid (it
might be possible to do this with XML Schema, not sure what support
XML Schema has yet).

    Nicolás>   * The config file writer (and other tools) could easily
    Nicolás> created with XSLT.

I have seen criticism on this thread that XSLT is slow.

However, there is now a C version of Xalan packaged for Debian (IIRC),
and I think you will find it ends up being fast and efficient (not
sure where it currently is in development though).

I am not experienced in certain optimisations for XSLT, such as
pre-compiling files, so can't really comment on these.

While XSLT is defined as XML --> XML translation, Xalan supports
a text mode translation, which I have successfully used to
create shell scripts.

Also, while XSL files could get very complicated, I would imagine
for most (if not all cases) of configuration files it is very simple.

However, if people still argue that XSLT is insufficient, other
methods of translating files from some packages could be used instead.

Yes, it would be a big change, and no, I don't expect everyone to rush
for it at once.

Brian May <bam@debian.org>

Reply to: