[augeas-devel] Writing lens for modules.autload.d

Doug Warner doug at warner.fm
Fri Oct 1 14:59:27 UTC 2010


I think I fixed it by changing my record to initialize my "option" counter:

  let record = [ counter "option" . key word .
                 [ seq "option" . s . ( opt | optval ) ]* .
                 eol ]

I'm not sure if this is the intended behavior, by my test seems to come out
properly:

Test result: modulesautoload.aug:35.2-.92:
  { "ip_gre"
    { "1"
      { "option1" = "a" }
    }
    { "2" = "option2" }
    { "3"
      { "option3" = "b" }
    }
  }
  { "8021q"
    { "1"
      { "option4" = "c" }
    }
    { "2" = "option5" }
    { "3"
      { "option6" = "d" }
    }
  }

-Doug


On 10/01/2010 09:56 AM, Doug Warner wrote:
> I'm trying to write a lens for modules.autoload.d which seems to be going
> well.  I'm trying to figure out how I can have a sequence re-start its
> numbering or new sub-trees; this is the test-case I'm referring to:
> 
> Test result: modulesautoload.aug:39.2-.56:
>   { "ip_gre"
>     { "1"
>       { "option1" = "a" }
>     }
>   }
>   { "8021q"
>     { "2"
>       { "option2" = "b" }
>     }
>   }
> 
> I would expect the '2' for the "8021q" sub-tree to be a "1" since its the
> first option for that sub-tree.
> 
> My lens is attached; let me know if you don't receive it.
> 
> -Doug
> 
> 
> 
> _______________________________________________
> augeas-devel mailing list
> augeas-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/augeas-devel


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20101001/ab236f2a/attachment.sig>


More information about the augeas-devel mailing list