3 Parses Thttpd's configuration files
5 Author: Marc Fournier <marc.fournier@camptocamp.com>
8 This lens is based on Thttpd's default thttpd.conf file.
12 augtool> get /files/etc/thttpd/thttpd.conf/port
13 /files/etc/thttpd/thttpd.conf/port = 80
15 augtool> set /files/etc/thttpd/thttpd.conf/port 8080
19 The <Test_Thttpd> file also contains various examples.
22 This file is licensed under the LGPL v2+, like the rest of Augeas.
28 let comment = Util.comment
29 let comment_eol = Util.comment_generic /[ \t]*[#][ \t]*/ " # "
30 let empty = Util.empty
31 let eol = Util.del_str "\n"
32 let bol = Util.del_opt_ws ""
34 let kvkey = /(port|dir|data_dir|user|cgipat|throttles|host|logfile|pidfile|charset|p3p|max_age)/
35 let flag = /(no){0,1}(chroot|symlinks|vhost|globalpasswd)/
36 let val = /[^\n# \t]*/
38 let kventry = key kvkey . Util.del_str "=" . store val
39 let flagentry = key flag
41 let kvline = [ bol . kventry . (eol|comment_eol) ]
42 let flagline = [ bol . flagentry . (eol|comment_eol) ]
44 let lns = (kvline|flagline|comment|empty)*
46 let filter = incl "/etc/thttpd/thttpd.conf"
48 let xfm = transform lns filter