Blame lenses/memcached.aug
|
Packit Service |
a2ae7a |
(*
|
|
Packit Service |
a2ae7a |
Module: Memcached
|
|
Packit Service |
a2ae7a |
Parses Memcached's configuration files
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
Author: Marc Fournier <marc.fournier@camptocamp.com>
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: Reference
|
|
Packit Service |
a2ae7a |
This lens is based on Memcached's default memcached.conf file.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: Usage Example
|
|
Packit Service |
a2ae7a |
(start code)
|
|
Packit Service |
a2ae7a |
augtool> get /files/etc/memcached.conf/u
|
|
Packit Service |
a2ae7a |
/files/etc/memcached.conf/u = nobody
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
augtool> set /files/etc/memcached.conf/m 128
|
|
Packit Service |
a2ae7a |
augtool> save
|
|
Packit Service |
a2ae7a |
Saved 1 file(s)
|
|
Packit Service |
a2ae7a |
(end code)
|
|
Packit Service |
a2ae7a |
The <Test_Memcached> file also contains various examples.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: License
|
|
Packit Service |
a2ae7a |
This file is licensed under the LGPL v2+, like the rest of Augeas.
|
|
Packit Service |
a2ae7a |
*)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
module Memcached =
|
|
Packit Service |
a2ae7a |
autoload xfm
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let comment = Util.comment
|
|
Packit Service |
a2ae7a |
let comment_eol = Util.comment_generic /[#][ \t]*/ "# "
|
|
Packit Service |
a2ae7a |
let option = /[a-zA-Z]/
|
|
Packit Service |
a2ae7a |
let val = /[^# \n\t]+/
|
|
Packit Service |
a2ae7a |
let empty = Util.empty
|
|
Packit Service |
a2ae7a |
let eol = Util.del_str "\n"
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let entry = [ Util.del_str "-" . key option
|
|
Packit Service |
a2ae7a |
. ( Util.del_ws_spc . (store val) )?
|
|
Packit Service |
a2ae7a |
. del /[ \t]*/ "" . (eol|comment_eol) ]
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let logfile = Build.key_value_line_comment
|
|
Packit Service |
a2ae7a |
"logfile" Sep.space (store val) comment
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let lns = ( entry | logfile | comment | empty )*
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let filter = incl "/etc/memcached.conf"
|
|
Packit Service |
a2ae7a |
. incl "/etc/memcachedb.conf"
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let xfm = transform lns filter
|