[Asterisk-Dev] generation of config files from source code ?

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Sun Nov 20 11:47:44 MST 2005


On Sunday 20 November 2005 03:42, Luigi Rizzo wrote:
> How about this to keep sample config files in sync with the source
> code:
>
> put the example config file for a channel/module/whatever embedded
> in a comment in the source code (much like what is in
> channels/chan_oss.c) and put in the configs/ directory a Makefile
> and a small awk script to generate the sample from the source file.

I think I understand what you're trying to do, but I also think this
is the wrong approach.  We certainly need to keep the config files in
sync with the source, so we don't have undocumented configuration
options.  That's best done with a policy directive that whenever you
add or change an option, you must also update the configuration file.

Keeping the configuration file inline with the source doesn't actually
solve the problem -- it merely moves the problem to a different
source file.  Keeping the configuration inline with the source may
even lead to a worse situation -- having a configuration inline which
doesn't accurately reflect the code it's sitting right next to!

-- 
Tilghman



More information about the asterisk-dev mailing list