[augeas-devel] [Augeas] #231: Set issue with recursive lens

Augeas trac at fedorahosted.org
Thu Nov 17 10:33:42 UTC 2011


#231: Set issue with recursive lens
---------------------+------------------------------------------------------
 Reporter:  raphink  |       Owner:  lutter
     Type:  defect   |      Status:  new   
 Priority:  major    |   Milestone:  next  
Component:  Augeas   |     Version:  devel 
 Keywords:           |  
---------------------+------------------------------------------------------
 I've tried to build recursive lenses a few times, and always end up with
 weird situations involving some kind of failure to match labels.

 Here is a simple example:

 {{{
 module Malformed =

   let fix_kv (lns:lens) = [ key /[a-z]+/
                           . ( (del /\./ "." . lns)
                             | (del "=" "=" . store /[a-z]+/) ) ]

   let rec kv = fix_kv kv

   let lns = Util.indent . kv

   test lns get "foo.bar=baz" = { "foo" { "bar" = "baz" } }

   test lns put "foo.bar=baz" after
      set "foo/bar" "faz" = ?
 }}}

 The get test works, but the set test fails with:
 {{{
 malformed.aug:13.2-14.28:exception thrown in test
 malformed.aug:13.7-14.24:exception: Failed to match
     <<rec:{ /[a-z]+/ = /(([a-z]+))/ }>>
   with tree
     { "foo" }
     Lens: malformed.aug:9.12-.28:
     Error encountered at path

 Syntax error in lens definition
 Failed to load malformed.aug
 }}}

-- 
Ticket URL: <https://fedorahosted.org/augeas/ticket/231>
Augeas <http://augeas.net/>
a configuration API




More information about the augeas-devel mailing list