[Wellington-pm] Complex config files

Dan Horne dan.horne at redbone.co.nz
Wed May 13 20:01:09 PDT 2009


Your requirements - if not your example file - seem ideally suited to  
Config::General (i don't know about the Debian bit, however)
On 14/05/2009, at 01:13 PM, Lesley Longhurst wrote:

> Hi all,
> Some of you may remember a while ago I brought in some code from  
> work to talk about, and it was based around a truly hideous config  
> file.
>
> I'm now working on replacing some of that stuff with a new script,  
> and the time has come to invent a better config file format. So, I'm  
> interested in recommendations for a good module to use for reading  
> and writing complex config files.
>
> Ideally, such a module would meet the following requirements:
> - well-documented
> - currently supported
> - a usable version available in a Debian package for Etch
>
> and the config file itself needs to
> - be easily read and edited by humans
> - support repeated sub-sections
> - allow multiple entries for parameters within the same section and  
> sub-section
> - allow for lots of comments
>
> Any suggestions?
>
> By way of example, I've attached a first cut of the sort of thing  
> I'm thinking of (and for your amusement I've also attached a  
> fragment of the existing config file that I derived it from.)
>
>
> -- 
> Lesley Longhurst (previously Walker)
> Linux Systems Administrator
> Opus International Consultants Ltd
> Email lesley.longhurst at opus.co.nz
> Tel +64 4 471 7002, Fax +64 4 473 3017
> http://www.opus.co.nz
> Level 9  Majestic Centre, 100 Willis Street, PO Box 12 343
> Wellington, New Zealand
>
>
> #  
> ------------------------------------------------------------------------
> # <informational comments etc>
> #  
> ------------------------------------------------------------------------
> Hosts,"COMMON UTILS",<an external command that generates a list>
> Include(zzsv01|zysv01),,--delete,"Utils",office/branchapp/cad_deploy/ 
> utils
>
> Include(zzsv01),,--delete,"OpusCAD partial menu",office/branchapp/ 
> opuscad
> Include(zysv01),,--delete,"Standard AutoCAD",office/branchapp/acad
>
> # -- OpusNetSoftwareUpdateEngine (SUE) - 50M
> # SUE is needed by sites that use Microstran or Google Sketchup.
> # Since it's small and developed in-house, it can go to all BOS  
> servers
> Include,,--delete,"SUE",office/branchapp/OpusNetSoftwareUpdateEngine
>
> #  
> ------------------------------------------------------------------------
> # <informational comments etc>
> #  
> ------------------------------------------------------------------------
> # -- dwgtrueconvert2007 - 34M
> Hosts,"DWG VIEWERS ETC FOR ALL",<an external command that generates  
> a list>,(zzsv01),(zysv01)
> Include,,--delete,"dwgtrueconvert2007",office/branchapp/cad_deploy/ 
> dwgtrueconvert2007
> Exclude,,,,office/branchapp/cad_deploy/dwgtrueconvert2007/AdminImage/ 
> Log/*
> Include,,,,office/branchapp/cad_deploy/dwgtrueconvert2007/AdminImage/ 
> Log/some.file.or.other
>
> # -- dwgtrueview2009 - 195M
> Include,,--delete,"dwgtrueview2009",office/branchapp/cad_deploy/ 
> dwgtrueview2009
> Exclude,,,,office/branchapp/cad_deploy/dwgtrueview2009/AdminImage/ 
> Log/*
>
> # -- object_enablers - 47M
> Include,,--delete,"object_enablers",office/branchapp/cad_deploy/ 
> object_enablers
> Exclude,,,,office/branchapp/cad_deploy/object_enablers/AdminImage/ 
> Log/*
> #  
> ------------------------------------------------------------------------
> # <informational comments etc>
> #  
> ------------------------------------------------------------------------
> label:       COMMON UTILS
>    servers: <an external command that generates a list>
>
>    include:    office/branchapp/cad_deploy/utils
>        description: Utils
>        rsync_flags: --delete
>        exclude-server: zzsv01
>        exclude-server: zysv01
>
>    include:    office/branchapp/opuscad
>        description: OpusCAD partial menu
>        rsync_flags: --delete
>        exclude-server: zzsv01
>
>    include:    office/branchapp/acad
>        description: Standard AutoCAD
>        rsync_flags: --delete
>        exclude-server: zysv01
>
>    include:    office/branchapp/OpusNetSoftwareUpdateEngine
>        description: OpusNetSoftwareUpdateEngine (SUE)
>        comment:     SUE is needed by sites that use Microstran or  
> Google Sketchup.
>        comment:     Since it's small and developed in-house, it can  
> go to all BOS servers
>        size:        50M
>        rsync_flags: --delete
>
> #  
> ------------------------------------------------------------------------
> # <informational comments etc>
> #  
> ------------------------------------------------------------------------
> label:       DWG VIEWERS ETC FOR ALL
>    servers:        <an external command that generates a list>
>    servers:        <whitespace-separated list>
>    exclude-server: zzsv01
>    exclude-server: zysv01
>
>    include:    office/branchapp/cad_deploy/dwgtrueconvert2007
>        description: dwgtrueconvert2007
>        size:        34M
>        rsync_flags: --delete
>        exclude:     office/branchapp/cad_deploy/dwgtrueconvert2007/ 
> AdminImage/Log/*
>        include:     office/branchapp/cad_deploy/dwgtrueconvert2007/ 
> AdminImage/Log/some.file.or.other
>
>    include:    office/branchapp/cad_deploy/dwgtrueview2009
>        description: dwgtrueview2009
>        size:        195M
>        rsync_flags: --delete
>        exclude:     office/branchapp/cad_deploy/dwgtrueview2009/ 
> AdminImage/Log/*
>
>    include:    office/branchapp/cad_deploy/object_enablers
>        description: object_enablers
>        size:        47M
>        rsync_flags: --delete
>        exclude:     office/branchapp/cad_deploy/object_enablers/ 
> AdminImage/Log/*
> _______________________________________________
> Wellington-pm mailing list
> Wellington-pm at pm.org
> http://mail.pm.org/mailman/listinfo/wellington-pm



More information about the Wellington-pm mailing list