[augeas-devel] Syslinux config file lens

David Lutterkort lutter at redhat.com
Tue Aug 4 22:57:32 UTC 2009


On Sat, 2009-08-01 at 10:56 +1000, Matthew Palmer wrote:
> Finally got it doing everything I want!  Basically, this lens just manages
> the configuration for the syslinux family of bootloaders.  I personally only
> use it for our boot servers' pxelinux configs, but the Internets assure me
> that the format is the same for all of them.

Very nice. A few questions:

Do you insist on GPL for these files ? Augeas is licensed under LGPLv2+.
I don't think there are any practical differences for a lens, but there
has been some confusion in the past about lenses under GPL, which I'd
like to avoid.

In syslinux.aug:

>         let global_option = [ del /[Ii][Nn][Cc][Ll][Uu][Dd][Ee]/ "include" . label "include" . option_value ]
>                            |[ del /[Kk][Ee][Rr][Nn][Ee][Ll]/ "kernel" . label "kernel" . option_value ]
>                            ....

How about

                let global_option =
                  let opt (canon:string) (re:regexp) =
                    [ del re canon . label canon . option_value ] in
                  opt "include" /[Ii][Nn][Cc][Ll][Uu][Dd][Ee]/
                 |opt "kernel" /[Kk][Ee][Rr][Nn][Ee][Ll]/
                 ....

That would be much more readable.
        
> (*      let global_option = [ valid_option   key ( /[^ \t\n\/#]+/ - /([Aa][Pp][Pp][Ee][Nn][Dd]|[Ll][Aa][Bb][Ee][Ll])/ )
>                               . wsp
>                               . store /[^ \t\n].*/
>                               . del /\n/ "\n"
>                             ]
> *)

That should be deleted.

David





More information about the augeas-devel mailing list