3 Cockpit module for Augeas
5 Author: Pat Riehecky <riehecky@fnal.gov>
7 About: Configuration files
8 cockpit.conf is a standard INI File.
11 This file is licenced under the LGPL v2+, like the rest of Augeas.
17 (************************************************************************
19 *************************************************************************)
21 let comment = IniFile.comment "#" "#"
22 let sep = IniFile.sep "=" "="
23 let empty = Util.empty
26 (************************************************************************
28 *************************************************************************)
30 let list_entry (list_key:string) =
31 let list_value = store /[^# \t\r\n,][^ \t\r\n,]*[^# \t\r\n,]|[^# \t\r\n,]/ in
32 let list_sep = del /([ \t]*(,[ \t]*|\r?\n[ \t]+))|[ \t]+/ " " in
33 [ key list_key . sep . Sep.opt_space . list_value ]
34 . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?
37 let entry_re = IniFile.entry_re - ("Origins" | "Fatal")
39 let entry = IniFile.entry entry_re sep comment
43 let list_entry_elem (k:string) = list_entry k . entry*
45 | entry* . Build.combine_two_opt
46 (list_entry_elem "Origins")
47 (list_entry_elem "Fatal")
50 (***********************************************************************a
52 *************************************************************************)
53 let title = IniFile.title IniFile.record_re
54 let record = [ title . entries ]
57 (************************************************************************
59 *************************************************************************)
60 let lns = (empty | comment)* . record*
62 let filter = (incl "/etc/cockpit/cockpit.conf")
64 let xfm = transform lns filter