A | |
access, Access | |
address, Pg_Hba | |
alias | |
alias_entry, Sudoers | |
alias_entry_single, Sudoers | |
alias_field, Sudoers | |
alias_list, Sudoers | |
alias_name, Sudoers | |
B | |
blacklist, Modprobe | |
block, Keepalived | |
body, Xinetd | |
bool, Host_Conf | |
bool_warn, Host_Conf | |
boot, Grub | |
boot_setting, Grub | |
brackets, Build | |
by, Reprepro_Uploaders | |
by_key, Reprepro_Uploaders | |
C | |
chainloader, Grub | |
clear, AptConf | |
client, Hosts_Access | |
client_list, Hosts_Access | |
cmd_kv, Solaris_System | |
cmd_moddir, Solaris_System | |
cmd_set, Solaris_System | |
cmnd_alias, Sudoers | |
cmnd_spec, Sudoers | |
cmnd_spec_list, Sudoers | |
colon | |
color, Grub | |
comma | |
comma_sep_list | |
command | |
comment | |
comment_c_style, Util | |
comment_eol | |
comment_generic, Util | |
comment_multi, AptConf | |
comment_multiline, Util | |
comment_or_eol | |
comment_re, Grub | |
comment_simple, AptConf | |
common_entry, Mke2fs | |
condition, Reprepro_Uploaders | |
condition_field, Reprepro_Uploaders | |
condition_list, Reprepro_Uploaders | |
condition_re, Reprepro_Uploaders | |
config, Modprobe | |
configfile, Grub |
Allow (+) or deny (-) access
let access = label "access" . store /[+-]/
let address = [ label "address" . store ipaddr ]
let alias = let modulename = [ label "modulename" . sto_no_spaces ] in Build.key_value_line_comment "alias" sep_space (sto_no_spaces . sep_space . modulename) comment
let alias = [ label "alias" . store word_re ]
Every kind of Alias entry, see user_alias, runas_alias, host_alias and cmnd_alias
let alias = user_alias | runas_alias | host_alias | cmnd_alias
Alias entry, a list of comma-separated alias_entry_single fields
let alias_entry (kw:string) (field:string) (sto:lens) = [ indent . key kw . sep_cont . alias_entry_single field sto . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]
Single alias_entry, named using alias_name and listing alias_list
let alias_entry_single (field:string) (sto:lens) = [ label "alias" . alias_name . sep_eq . alias_list field sto ]
Generic alias field to gather all Alias definitions
let alias_field (kw:string) (sto:lens) = [ label kw . sto ]
List of alias_fields, separated by commas
let alias_list (kw:string) (sto:lens) = alias_field kw sto . ( sep_com . alias_field kw sto )*
Name of an alias_entry_single
let alias_name = [ label "name" . store /[A-Z][A-Z0-9_]*/ ]
let blacklist = Build.key_value_line_comment "blacklist" sep_space sto_no_spaces comment
A simple block with just a block title
let block (kw:string) (sto:lens) = lens_block (key kw) sto
We would really like to say “the body can contain any of a list of a list of attributes, each of them at most once”; but that would require that we build a lens that matches the permutation of all attributes; with around 40 individual attributes, that’s not computationally feasible, even if we didn’t have to worry about how to write that down.
let body (attr:lens) = del /\n\{[ \t]*\n/ "\n{\n" . (empty|comment|attr)* . del /[ \t]*\}[ \t]*\n/ "}\n"
A boolean switch
let bool (kw:regexp) = Build.key_value_line kw Sep.space sto_bool
A boolean switch with extended values
let bool_warn (kw:regexp) = Build.key_value_line kw Sep.space sto_bool_warn
let boot = let line = ((boot_setting|comment)* . boot_setting)? in [ label "title" . title . line ]
boot entries
let boot_setting = kw_boot_arg "root" | kernel | kw_boot_arg "initrd" | kw_boot_arg "rootnoverify" | chainloader | kw_boot_arg "uuid" | kw_boot_arg "findroot" (* Solaris extension *) | kw_boot_arg "bootfs" (* Solaris extension *) | kw_pres "quiet" (* Seems to be a Ubuntu extension *) | savedefault | configfile | module_line | map_line
Put a lens inside brackets
let brackets (l:lens) (r:lens) (lns:lens) = l . lns . r
by statements define who is allowed to upload.
let by = [ key "by" . Sep.space . ( store ("anybody"|"unsigned") | by_key ) ]
When a key is used to authenticate packages, the value can either be a key ID or “any”:
let by_key = let any_key = [ store "any" . Sep.space . key "key" ] in let named_key = [ key "key" . Sep.space . store (Rx.word - "any") ] in value "key" . (any_key | named_key)
let chainloader = [ command "chainloader" "\t" . [ spc . switch "force" ]? . spc . store Rx.no_spaces . eol ]
A list of variables to clear /!\ The manpage is not clear on the syntax
let clear = let name = [ label "name" . store name_re_colons ] in [ indent . key "#clear" . Sep.space . Build.opt_list name Sep.space . eol ]
let client = let user = [ label "user" . store Rx.word . Util.del_str "@" ] in [ label "client" . user? . store Rx.word ]
A list of clients
let client_list = Build.opt_list client comma
Function for simple key/value setting commands such as rootfs
let cmd_kv (cmd:string) (value:regexp) = Build.key_value_line cmd sep_colon (store value)
The moddir command for specifying module search paths
let cmd_moddir = Build.key_value_line "moddir" sep_colon (Build.opt_list modpath sep_moddir)
The set command for individual kernel/module parameters
let cmd_set = [ key "set" . Util.del_ws_spc . ( set_var | set_varmod ) . set_sep_spc . [ label "operator" . store set_operators ] . set_sep_spc . set_value . Util.eol ]
Cmnd_Alias, see alias_field
let cmnd_alias = alias_entry "Cmnd_Alias" "command" sto_to_com_cmnd
Command specification for spec, with optional runas_spec and any amount of tag_specs
let cmnd_spec = [ label "command" . runas_spec? . tag_spec* . sto_to_com_cmnd ]
A list of comma-separated cmnd_specs
let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*
Separation between the alias and it’s destinations
let colon = del /[ \t]*:[ \t]+/ ":\t"
let colon = del /[ \t]*:[ \t]*/ ": "
let color =
Separation between multiple destinations
let comma = del /[ \t]*,[ \t]*(\n[ \t]+)?/ ", "
let comma = del /([ \t]|(\\\\\n))*,([ \t]|(\\\\\n))*/ ", "
A comma separated list of options (opt=value or opt)
let comma_sep_list (l:string) = let value = [ label "value" . Util.del_str "=" . store optval ] in let lns = [ label l . store word . value? ] in Build.opt_list lns comma
let command (kw:regexp) (indent:string) = Util.del_opt_ws indent . key kw
nrpe.cfg usually has many entries defining commands to run
let command = let obrkt = del /\[/ "[" in let cbrkt = del /\]/ "]" in [ key "command" . [ obrkt . key /[^]\/\n]+/ . cbrkt . eq . store /[^\n]+/ . del /\n/ "\n" ] ]
let comment = Util.comment
let comment = [ indent . label "#comment" . del /[#;][ \t]*/ "# " . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]
A comment, either comment_simple or comment_multi
let comment = comment_simple | comment_multi
let comment = [ Util.indent . label "#comment" . del /#[ \t]*/ "# " . store comment_re . eol ]
Map comments into “#comment” nodes
let comment (pat:regexp) (default:string) = [ label "#comment" . sep pat default . sto_to_eol? . eol ]
Map comments in “#comment” nodes
let comment = Util.comment_generic /[ \t]*[#!][ \t]*/ "# "
let comment = IniFile.comment IniFile.comment_re IniFile.comment_default
let comment = Util.comment
Nrpe comments must start at beginning of line
let comment = Util.comment_generic /#[ \t]*/ "# "
let comment = Util.comment
let comment = Util.comment_generic /[ \t]*[;#][ \t]*/ "# "
An IniFile.comment entry
let comment = IniFile.comment "#" "#"
let comment = Util.comment_generic /[ \t]*\*[ \t]*/ "* "
Map comments in “#comment” nodes
let comment = let sto_to_eol = store (/([^ \t\n].*[^ \t\n]|[^ \t\n])/ - /include(dir)?.*/) in [ label "#comment" . del /[ \t]*#[ \t]*/ "# " . sto_to_eol . eol ]
Map comments into “#comment” nodes Can’t use Util.comment as #+ and #!
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n+!-].*[^ \t\n]|[^ \t\n+!-])/ . eol ]
Map comments into “#comment” nodes
let comment = comment_generic /[ \t]*#[ \t]*/ "# "
A comment line, C-style
let comment_c_style = comment_generic /[ \t]*\/\/[ \t]*/ "// "
Map comments at eol
let comment_eol = Util.comment_generic /[ \t]*[#!][ \t]*/ " # "
let comment_eol = Util.comment_generic /[ \t]*[;#][ \t]*/ " # "
Requires a space before the #
let comment_eol = Util.comment_generic /[ \t]+#[ \t]*/ " # "
Map eol comments into “#comment” nodes Add a space before # for end of line comments
let comment_eol = comment_generic /[ \t]*#[ \t]*/ " # "
Map comments and set default comment sign
let comment_generic (r:regexp) (d:string) = [ label "#comment" . del r d . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]
A multiline comment, C-style
let comment_multi = Util.comment_multiline
A C-style multiline comment
let comment_multiline = let mline_re = (/[^ \t\n].*[^ \t\n]|[^ \t\n]/ - /.*\*\/.*/) in let mline = [ seq "mline" . del /[ \t\n]*/ "\n" . store mline_re ] in [ label "#mcomment" . del /[ \t]*\/\*/ "/*" . counter "mline" . mline . (eol . mline)* . del /[ \t\n]*\*\/[ \t]*\n/ "\n*/\n" ]
A comment_eol or eol
let comment_or_eol = comment_eol | (del /[ \t]*[#!]?\n/ "\n")
A comment_eol or eol
let comment_or_eol = comment_eol | (del /([ \t]+#\n|[ \t]*\n)/ "\n")
A comment_eol or eol, with an optional empty comment
let comment_or_eol = comment_eol | (del /[ \t]*(#[ \t]*)?\n/ "\n")
let comment_re = /([^ \t\n].*[^ \t\n]|[^ \t\n])/ - /# ## (Start|End) Default Options ##/
A one-line comment, C-style
let comment_simple = Util.comment_c_style
Entries shared between defaults and fs_types sections
let common_entry = list_sto ("base_features"|"default_features") (key Rx.word) | entry_sto "blocksize" ("-"? . Rx.integer) | entry_sto "hash_alg" ("legacy"|"half_md4"|"tea") | entry_sto ("inode_ratio"|"inode_size") Rx.integer
A condition is an ‘and’ node, representing a union of condition_fields, listed under ‘or’ subnodes:
let condition = logic_construct_condition "or" condition_field
A single condition field is an ‘or’ node.
let condition_field = let sto_condition = Util.del_str "'" . store /[^'\n]+/ . Util.del_str "'" in [ key "not" . Sep.space ]? . store condition_re . [ Sep.space . key "contain" ]? . Sep.space . logic_construct_field "or" "|" sto_condition
A list of conditions, inspired by Debctrl.dependency_list An upload condition list is either the wildcard ‘*’, stored verbatim, or an intersection of conditions listed under ‘and’ subnodes:
let condition_list = store "*" | logic_construct_condition "and" condition
let condition_re = "source" | "byhand" | "sections" | "binaries" | "architectures"
let config = Build.key_value_line_comment "config" sep_space (store /binary_indexes|yes|no/) comment
let configfile = [ command "configfile" "\t" . spc . store Rx.no_spaces . eol ]