Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / cachefilesd.aug
1 (*
2 Module: Cachefilesd
3   Parses /etc/cachefilesd.conf
4
5 Author: Pat Riehecky <riehecky@fnal.gov>
6
7 About: Reference
8   This lens tries to keep as close as possible to `man 5 cachefilesd.conf` where possible.
9
10 About: License
11    This file is licenced under the LGPL v2+, like the rest of Augeas.
12
13 About: Lens Usage
14    See <lns>.
15
16 About: Configuration files
17    This lens applies to /etc/cachefilesd.conf.
18
19 About: Examples
20    The <Test_Cachefilesd> file contains various examples and tests.
21 *)
22
23 module Cachefilesd =
24    autoload xfm
25
26    (************************************************************************
27     * Group:                 USEFUL PRIMITIVES
28     *************************************************************************)
29
30    (* Group: Comments and empty lines *)
31
32    (* View: eol *)
33    let eol   = Util.eol
34    (* View: comment *)
35    let comment = Util.comment
36    (* View: empty *)
37    let empty = Util.empty
38
39    (* Group: separators *)
40
41    (* View: space
42     * Separation between key and value
43     *)
44    let space = Util.del_ws_spc
45
46    (* View: colon
47     * Separation between selinux attributes
48     *)
49    let colon = Sep.colon
50
51    (* Group: entries *)
52
53    (* View: entry_key
54     * The key for an entry in the config file
55     *)
56    let entry_key = Rx.word
57
58    (* View: entry_value
59     * The value for an entry may contain all sorts of things
60     *)
61    let entry_value = /[A-Za-z0-9_.-:%]+/
62
63    (* View: nocull
64     * The nocull key has different syntax than the rest
65     *)
66    let nocull = /nocull/i
67
68    (* Group: config *)
69
70    (* View: cacheconfig
71     * This is a simple "key value" setup
72     *)
73    let cacheconfig = [ key (entry_key - nocull) . space
74                      . store entry_value . eol ]
75
76    (* View: nocull
77     * This is a either present, and therefore active or missing and
78     * not active
79     *)
80    let nocull_entry = [ key nocull . eol ]
81
82   (* View: lns *)
83   let lns = (empty | comment | cacheconfig | nocull_entry)*
84
85   let xfm = transform lns (incl "/etc/cachefilesd.conf")
86
87 (* Local Variables: *)
88 (* mode: caml *)
89 (* End: *)