1 (* Rsyncd module for Augeas
2 Author: Marc Fournier <marc.fournier@camptocamp.com>
4 Reference: man rsyncd.conf(5)
11 (************************************************************************
13 *************************************************************************)
14 let comment = IniFile.comment IniFile.comment_re "#"
15 let sep = IniFile.sep IniFile.sep_re IniFile.sep_default
16 let indent = del /[ \t]*/ " "
18 (* Import useful INI File primitives *)
20 let empty = IniFile.empty
23 . store /[^;# \t\n][^;#\n]*[^;# \t\n]|[^;# \t\n]/
26 (************************************************************************
28 * rsyncd.conf allows indented entries, but by default entries outside
29 * sections are unindented
30 *************************************************************************)
31 let entry_re = /[A-Za-z0-9_.-][A-Za-z0-9 _.-]*[A-Za-z0-9_.-]/
33 let entry = IniFile.indented_entry entry_re sep comment
35 (************************************************************************
37 * We use IniFile.title_label because there can be entries
38 * outside of sections whose labels would conflict with section names
39 *************************************************************************)
40 let title = IniFile.indented_title ( IniFile.record_re - ".anon" )
41 let record = IniFile.record title entry
43 let record_anon = [ label ".anon" . ( entry | empty )+ ]
45 (************************************************************************
47 * There can be entries before any section
48 * IniFile.entry includes comment management, so we just pass entry to lns
49 *************************************************************************)
50 let lns = record_anon? . record*
52 let filter = (incl "/etc/rsyncd.conf")
54 let xfm = transform lns filter