Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / dput.aug
1 (* Dput module for Augeas
2    Author: Raphael Pinson <raphink@gmail.com>
3
4
5    Reference: dput uses Python's ConfigParser:
6      http://docs.python.org/lib/module-ConfigParser.html
7 *)
8
9
10 module Dput =
11   autoload xfm
12
13
14 (************************************************************************
15  * INI File settings
16  *************************************************************************)
17 let comment  = IniFile.comment IniFile.comment_re IniFile.comment_default
18
19 let sep      = IniFile.sep IniFile.sep_re IniFile.sep_default
20
21
22 let setting = "allow_dcut"
23             | "allow_non-us_software"
24             | "allow_unsigned_uploads"
25             | "check_version"
26             | "default_host_main"
27             | "default_host_non-us"
28             | "fqdn"
29             | "hash"
30             | "incoming"
31             | "login"
32             | "method"
33             | "passive_ftp"
34             | "post_upload_command"
35             | "pre_upload_command"
36             | "progress_indicator"
37             | "run_dinstall"
38             | "run_lintian"
39             | "scp_compress"
40             | "ssh_config_options"
41             | "allowed_distributions"
42
43 (************************************************************************
44  * "name: value" entries, with continuations in the style of RFC 822;
45  * "name=value" is also accepted
46  * leading whitespace is removed from values
47  *************************************************************************)
48 let entry = IniFile.entry setting sep comment
49
50
51 (************************************************************************
52  * sections, led by a "[section]" header
53  * We can't use titles as node names here since they could contain "/"
54  * We remove #comment from possible keys
55  * since it is used as label for comments
56  * We also remove / as first character
57  * because augeas doesn't like '/' keys (although it is legal in INI Files)
58  *************************************************************************)
59 let title   = IniFile.title_label "target" IniFile.record_label_re
60 let record  = IniFile.record title entry
61
62 let lns    = IniFile.lns record comment
63
64 let filter = (incl "/etc/dput.cf")
65            . (incl (Sys.getenv("HOME") . "/.dput.cf"))
66
67 let xfm = transform lns filter
68