[augeas-devel] [Augeas] #6: Augeas 0.3.0 seems to use the labels to check lenses

Augeas trac at fedorahosted.org
Wed Aug 13 12:14:25 UTC 2008


#6: Augeas 0.3.0 seems to use the labels to check lenses
---------------------+------------------------------------------------------
 Reporter:  raphink  |       Owner:  lutter
     Type:  defect   |      Status:  new   
 Priority:  major    |   Milestone:  next  
Component:  Augeas   |     Version:  0.2.2 
 Keywords:           |  
---------------------+------------------------------------------------------
 {{{

 module Puppet =
   autoload xfm

 let entry  = IniFile.entry /[a-z][a-z0-9_-]+/
 let record = IniFile.record "section" entry
 let lns    = IniFile.lns record

 let filter = (incl "/etc/puppet/puppet.conf")

 let xfm = transform lns filter
 }}}


 {{{
  $ augparse -I . puppet.aug
 puppet.aug:12.0-.43:Failed to compile record
 ./inifile.aug:64.8-.24:exception: overlapping lenses in tree union.put
     Example matched by both: 'comment/'
     First lens: ./inifile.aug:44.22-.74
     Second lens: ./inifile.aug:30.27-31.29

 puppet.aug: error: Loading failed
 }}}


 inifile.aug:44 :
 {{{
 let entry_generic (kw:regexp) (sep:lens) (comment:lens)
                     = [ key kw . sep . value_to_comment? . (comment|eol) ]
 }}}

 inifile.aug:30 :
 {{{
 let comment_generic (pat:regexp) (default:string)
                          = [ label "comment" . sep_gen pat default
                            .  value_to_eol . eol ]
 }}}


 It seems that `kw /[a-z][a-z0-9_-]+/` conflicts with `label "comment"`. I
 don't see any other explanation. If I change `label "comment"` to `label
 "Comment"`, the lens compiles properly, so it seems that the lens checker
 uses the labels to check for conflicts, which is a bug.

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




More information about the augeas-devel mailing list