3 Parses /etc/cgrules.conf
6 Raphael Pinson <raphink@gmail.com>
7 Ivana Hutarova Varekova <varekova@redhat.com>
10 This file is licensed under the LGPL v2+, like the rest of Augeas.
13 Sample usage of this lens in augtool:
15 About: Configuration files
16 This lens applies to /etc/cgconfig.conf. See <filter>.
22 (************************************************************************
23 * Group: USEFUL PRIMITIVES
24 *************************************************************************)
26 (* Group: Separators *)
28 let ws = del /[ \t]+/ " "
30 (* Group: Comments and empty lines *)
34 (* Variable: comment *)
35 let comment = Util.comment
38 let empty = Util.empty
40 (* Group: Generic primitive definitions *)
42 let name = /[^@%# \t\n][^ \t\n]*/
43 (* Variable: ctrl_key *)
44 let ctrl_key = /[^ \t\n\/]+/
45 (* Variable: ctrl_value *)
46 let ctrl_value = /[^ \t\n]+/
48 (************************************************************************
50 *************************************************************************)
52 (* Variable: controller *)
53 let controller = ws . [ key ctrl_key . ws . store ctrl_value ]
55 let more_controller = Util.del_str "%" . controller . eol
57 (************************************************************************
59 *************************************************************************)
61 let generic_record (lbl:string) (lns:lens) =
66 (* Variable: user_record *)
67 let user_record = generic_record "user" (store name)
69 (* Variable: group_record *)
70 let group_record = generic_record "group" (Util.del_str "@" . store name)
72 (************************************************************************
73 * Group: LENS & FILTER
74 *************************************************************************)
77 The main lens, any amount of
83 let lns = ( empty | comment | user_record | group_record )*
85 let xfm = transform lns (incl "/etc/cgrules.conf")