Re: use and abuse of debconf
Just a thought: What about having, for each kind of config file, a program
that converts it from and to an XML version, so:
-----------------------
# This is a comment
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address 10.1.2.2
network 10.1.0.0
netmask 255.255.0.0
broadcast 10.1.255.255
gateway 10.1.2.254
up ifconfig eth0:0 10.1.2.22 netmask 255.255.0.0 broadcast
10.1.255.255
down ifconfig eth0:0 down
-----------------------
would become:
<interfaces>
<comment>This is a comment</comment>
<auto>lo</auto>
<auto>inet</auto>
<auto>loopback</auto>
<iface name="lo" family="inet" method="loopback"/>
<iface name="eth0" family="inet" method="static">
<address>10.1.2.2</address>
<network>10.1.0.0</network>
<netmask>255.255.0.0</netmask>
<broadcast>10.1.255.255</broadcast>
<gateway>10.1.2.254</gateway>
</iface>
</interfaces>
---------------------
This would provide:
* A generic way to show hierarchical configuration data (I think that
any config file can be expressed in an information tree).
* A standard way to refer to a configuration option (xpath):
/interfaces/iface[1] would access the first iface, and
/interfaces/iface[2] the second.
* The config file writer (and other tools) could easily created
with XSLT.
Reply to: