Re: sysinst split project - The Configuration File

Alexander Nasonov <[email protected]>
Newsgroups gmane.os.netbsd.current,gmane.os.netbsd.devel.installation
Message-ID <[email protected]>
David Young wrote:
> Use XML for the configuration.  That ensures that the configuration is
> queryable/transformable with NetBSD's forthcoming xmltools.  I know that
> writing XML by hand is objectionable, so establish a one-to-one mapping
> from your user-friendly format to an XML format.  Provide a tool to/from
> the XML format.

I wouldn't recommend XML route. Write a user-friendly lua script
instead. Someone posted an example in some (custom?) config language.
It can be easily transformed to a lua script:

-- Library code
function config(content)
end

function disk1()
end

function disklabel(content)
end

-- User config file
config {
        disk1 {
                disklabel {
                        ------------------
                }
        }
}

If one wants arbitrary section names, he or she can implement a function
that returns another function:

function section(name)
    return function(content) end
end

section "mysection" {}

Alex
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.