[augeas-devel] [Augeas] #342: Shellvars_list fails with inline comments

Augeas trac at fedorahosted.org
Thu May 2 14:05:16 UTC 2013


#342: Shellvars_list fails with inline comments
----------------------+---------------------
 Reporter:  kedarius  |       Owner:  lutter
     Type:  defect    |      Status:  new
 Priority:  major     |   Milestone:  next
Component:  Augeas    |     Version:  1.0.0
 Keywords:            |  Blocked By:
 Blocking:            |
----------------------+---------------------
 Shellvars_list lens fails on lines with inline comments, i.e.:

 {{{
 service_ping="ping/icmp" #ping
 }}}

 I copy/pasted some definitions from Shellvars:

 {{{
    let empty_part_re = Util.empty_generic_re . /\n+/
    let semicol_eol = del (/[ \t]*[;\n]/ . empty_part_re*) "\n"
    let eol_for_comment = del /([ \t]*\n)([ \t]*(#[ \t]*)?\n)*/ "\n"
   (* comment_eol in shell MUST begin with a space *)
    let comment_eol = Util.comment_generic_seteol /[ \t]+#[ \t]*/ " # "
 eol_for_comment
    let comment_or_eol = comment_eol | semicol_eol
 }}}
 and changed the kv definition to use comment_or_eol instead of eol:

 {{{
    let kv = [ key key_re . eq . ( squote_arr | dquote_arr | unquot_val ) .
 comment_or_eol ]
 }}}

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




More information about the augeas-devel mailing list