3 Parses simple key = value conffiles
5 Author: Raphael Pinson <raphink@gmail.com>
8 This file is licenced under the LGPL v2+, like the rest of Augeas.
14 The <Test_Simplevars> file contains various examples and tests.
21 (* Variable: to_comment_re
22 The regexp to match the value *)
24 let to_comment_squote = /'[^\n']*'/
25 in let to_comment_dquote = /"[^\n"]*"/
26 in let to_comment_noquote = /[^\n \t'"#][^\n#]*[^\n \t#]|[^\n \t'"#]/
27 in to_comment_squote | to_comment_dquote | to_comment_noquote
31 let some_value = Sep.space_equal . store to_comment_re
32 (* Avoid ambiguity in tree by making a subtree here *)
33 in let empty_value = [del /[ \t]*=/ "="] . store ""
34 in [ Util.indent . key Rx.word
35 . (some_value? | empty_value)
36 . (Util.eol | Util.comment_eol) ]
39 let lns = (Util.empty | Util.comment | entry)*
41 (* Variable: filter *)
42 let filter = incl "/etc/kernel-img.conf"
43 . incl "/etc/kerneloops.conf"
45 . incl "/etc/zabbix/*.conf"
46 . incl "/etc/audit/auditd.conf"
47 . incl "/etc/mixerctl.conf"
48 . incl "/etc/wsconsctlctl.conf"
49 . incl "/etc/ocsinventory/ocsinventory-agent.cfg"
51 let xfm = transform lns filter