Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / cyrus_imapd.aug
1 (*
2 Cyrus_Imapd module for Augeas
3
4 Author: Free Ekanayaka <free@64studio.com>
5 *)
6
7 module Cyrus_Imapd =
8
9    autoload xfm
10
11 (************************************************************************
12  *                           USEFUL PRIMITIVES
13  *************************************************************************)
14
15 let eol        = Util.eol
16 let indent     = del /[ \t]*(\n[ \t]+)?/ " "
17 let comment    = Util.comment
18 let empty      = Util.empty
19 let eq         = del /[ \t]*:/ ":"
20 let word       = /[A-Za-z0-9_.-]+/
21
22 (* The value of a parameter, after the '=' sign. Postfix allows that
23  * lines are continued by starting continuation lines with spaces.
24  * The definition needs to make sure we don't add indented comment lines
25  * into values *)
26 let value =
27   let chr = /[^# \t\n]/ in
28   let any = /.*/ in
29   let line = (chr . any* . chr | chr) in
30   let lines = line . (/\n[ \t]+/ . line)* in
31     store lines
32
33 (************************************************************************
34  *                               ENTRIES
35  *************************************************************************)
36
37 let entry     = [ key word . eq . (indent . value)? . eol ]
38
39 (************************************************************************
40  *                                LENS
41  *************************************************************************)
42
43 let lns        = (comment|empty|entry) *
44
45 let filter     = (incl "/etc/imapd.conf")
46                . (incl "/etc/imap/*.conf")
47                . Util.stdexcl
48
49 let xfm        = transform lns filter