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