On Fri, 2009-08-14 at 13:01 +1000, Matthew Palmer wrote:
> On Thu, Aug 13, 2009 at 06:49:49PM -0700, David Lutterkort wrote:
> > One  more question: how about parsing the arguments of an append into
> > nodes where the label is the name of the argument and the value is the
> > arg value; i.e. parse a line like
> 
> Line 52.  I'm happy to change that if you're happy to change the language. 
> <grin>

Aah .. I see. Yeah, alowing '/' in labels is a non-starter. How about
parsing the key/value pair into two nodes, like


        module T =
        
          let s = "label lenny64
                kernel vmlinuz-lenny64
                append vga=normal initrd=initrd.img-lenny64 
preseed/url=http://localhost/preseed.cfg --
        "
        
          test Syslinux.lns get s =
          { "label" = "lenny64"
            { "kernel" = "vmlinuz-lenny64" }
            { "append"
              { { "arg" = "vga" } { "value" = "normal" } }
              { { "arg" = "initrd" } { "value" = "initrd.img-lenny64" } }
              { { "arg" = "preseed/url" } { "value" = 
"http://localhost/preseed.cfg"; } }
              { { "arg" = "--" } } } }
        
It's a little friendlier to people who want to find where 'vga' is set.
I did that with the following in syslinux.aug:

        (***************************
         * APPEND OPTION HANDLING
         ***************************)

        let append_opt =
          [ wsp . [ label "arg" . store /[^= \t\n]+/] .
                  [ Util.delstr "=" . label "value" . store /[^= \t\n]+/]? ]

        let global_append = [ del /[Aa][Pp][Pp][Ee][Nn][Dd]/ "append"
                              . label "append"
                              . append_opt+
                              . eol
                            ]

David

_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to