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

Re: Admin tools - idea from left field

On Thu, 11 Feb 1999, Jules Bean wrote:

> On Wed, 10 Feb 1999, David Welton wrote:

> > Anyway, this situation my change by the time I actually get around to
> > doing anything.. I just was curious to hear other people out on the
> > basic idea.
> I don't know what the scope of what you're trying to do is, but if you're
> merely storing data, then I'd vote for the something like
> objectname = {
> 	name = value;
> 	name = value;
> 	subobj = {
> 		subname=value;
> 	}
> }
> Which is easy to parse, and easily extends to arbitrary (static)
> complexity.

Indeed it is, APT uses a config file that is basically identical to that,
the parser is about 300 lines of C++. It also integerates with the custom
command line parser to create a single in-memory database of key-value
pairs that represent the entire configuration space for the process. The
only difference is that I stole the syntax from the ISC tools (bind,
dhcp, etc)

It is quite simple and extendable, there is even a C program to interface
with shell scripts called apt-config, ie:

set -e
RES=`apt-config shell CLEAN DSelect::Clean OPTS DSelect::Options \
                      DPKG Dir::Bin::dpkg APTGET Dir::Bin::apt-get`
eval $RES

Works for me :>


Reply to: