Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / schroot.aug
1 (*
2 Module: Schroot
3   Parses /etc/schroot/schroot.conf
4
5 Author: Raphael Pinson <raphink@gmail.com>
6
7 About: Reference
8   This lens tries to keep as close as possible to `man 5 schroot.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    To be documented
15
16 About: Configuration files
17    This lens applies to /etc/schroot/schroot.conf. See <filter>.
18 *)
19
20
21 module Schroot =
22 autoload xfm
23
24
25 (************************************************************************
26  * Group:                 USEFUL PRIMITIVES
27  *************************************************************************)
28
29 (* View: comment
30    An <IniFile.comment> entry *)
31 let comment    = IniFile.comment "#" "#"
32
33 (* View: sep
34    An <IniFile.sep> entry *)
35 let sep        = IniFile.sep "=" "="
36
37
38 (************************************************************************
39  * Group:                 ENTRIES
40  *************************************************************************)
41
42 (* View: description
43    Descriptions are special entries, which can have an optional lang parameter *)
44 let description =
45      let lang = [ Util.del_str "[" . label "lang"
46                 . store IniFile.entry_re . Util.del_str "]" ]
47   in IniFile.entry_generic_nocomment (key "description" . lang?) sep "#" comment
48
49 (* View: entry
50    An <IniFile.entry>, or <description> *)
51 let entry   = IniFile.entry (IniFile.entry_re - "description") sep comment
52             | description
53
54 (* View: title
55    An <IniFile.title> *)
56 let title   = IniFile.title IniFile.record_re
57
58 (* View: record
59    An <IniFile.record> *)
60 let record = IniFile.record title entry
61
62 (* View: lns
63    An <IniFile.lns> *)
64 let lns    = IniFile.lns record comment
65
66 (* View: filter *)
67 let filter = (incl "/etc/schroot/schroot.conf")
68
69 let xfm = transform lns filter