S | |
savedefault, Grub | |
schedule, Cron | |
Schroot | |
screen, Xorg | |
search, Resolv | |
section, Xorg | |
section_entry, Xorg | |
section_re, Xorg | |
SECTIONS, Xorg | |
secton_re_obsolete, Xorg | |
selector, Syslog | |
selectors, Syslog | |
semicolon, Syslog | |
sep | |
Sep | |
sep_ace, Test_IniFile | |
sep_acf, Test_IniFile | |
sep_ade, Test_IniFile | |
sep_adf, Test_IniFile | |
sep_bce, Test_IniFile | |
sep_bcf, Test_IniFile | |
sep_bde, Test_IniFile | |
sep_bdf, Test_IniFile | |
sep_col, Sudoers | |
sep_colon | |
sep_com, Sudoers | |
sep_cont, Sudoers | |
sep_cont_opt, Sudoers | |
sep_default, IniFile | |
sep_dquot, Keepalived | |
sep_dquote | |
sep_eq | |
sep_moddir, Solaris_System | |
sep_opt_spc, Keepalived | |
sep_re, IniFile | |
sep_space, Modprobe | |
sep_spc | |
sep_tab | |
sep_tab_opt, Syslog | |
separators, Aliases | |
Separators | |
serial, Grub | |
service, Nsswitch | |
service_attr, Xinetd | |
Services | |
set_operator, Solaris_System | |
set_sep_spc, Solaris_System | |
set_value, Solaris_System | |
set_var, Solaris_System | |
shell_command, Hosts_Access | |
Shells | |
shellvar, Cron | |
Shellvars | |
simple_config, Test_FAI_DiskConfig | |
single characters macro, Syslog | |
size, FAI_DiskConfig | |
size_kw, FAI_DiskConfig | |
softdep, Modprobe | |
Solaris_System | |
sortlist, Resolv | |
space | |
space_in, Rx | |
Spaces, Rx | |
spare_missing, FAI_DiskConfig | |
spc, Grub | |
spec, Sudoers | |
spec_list, Sudoers | |
SPECIAL OPTIONS, Resolv | |
Split, Util | |
Ssh | |
Sshd | |
static_ipaddress_field, Keepalived | |
static_routes, Keepalived | |
static_routes_field, Keepalived | |
stdexcl, Util | |
sto_bool, Host_Conf | |
sto_bool_warn, Host_Conf | |
sto_email_addr, Keepalived | |
sto_integer, Sudoers | |
sto_no_colons, Modprobe | |
sto_no_spaces, Modprobe | |
sto_num, Keepalived | |
sto_to_com, Sudoers | |
sto_to_com_cmnd, Sudoers | |
sto_to_com_col, Sudoers | |
sto_to_com_host, Sudoers | |
sto_to_com_user, Sudoers | |
sto_to_comment | |
sto_to_eol | |
sto_to_eq, Sudoers | |
sto_to_spc, Sudoers | |
sto_to_spc_no_dquote, Sudoers | |
sto_word, Keepalived | |
Stores | |
SUBNODE CONSTRUCTIONS, Build | |
Sudoers | |
switch, Grub | |
switch_arg, Grub | |
Syslog |
let savedefault = [ command "savedefault" "\t" . (spc . store Rx.integer)? . eol ]
Time in the format “@keyword”
let schedule = [ label "schedule" . Util.del_str "@" . store schedule_re ]
The Screen entry of ServerLayout
let screen = [ indent . del /[sS]creen/ "Screen" . label "Screen" . sep_spc . [ label "num" . store int . sep_spc ]? . quoted_string_val . [ sep_spc . label "position" . store to_eol ]? . eol ]
let search = Build.key_value_line_comment "search" Sep.space (Build.opt_list [label "domain" . store Rx.word] Sep.space) comment_eol
A section in xorg.conf
let section = [ indent . del "Section" "Section" . sep_spc . sep_dquote . key (section_re|section_re_obsolete) . sep_dquote . eol . section_entry* . indent . del "EndSection" "EndSection" . eol ]
let section_entry = option | screen | display | input_device | driver | identifier | videoram | default_depth | device | entry_generic | empty | comment
Known values for Section names
let section_re = /(Extensions|Files|ServerFlags|Module|InputDevice|InputClass|Device|VideoAdaptor|Monitor|Modes|Screen|ServerLayout|DRI|Vendor)/
a list of selectors, separated by semicolons
let selectors = label_opt_list "selector" selector semicolon
Deletes a semicolon and default to it
let semicolon = sep_tab_opt . Util.del_str ";" . sep_tab_opt
Only treat one space as the sep, extras are stripped by IniFile
let sep = Util.del_str " "
let sep = /[ \t]+/
Generic separator
let sep (pat:regexp) (default:string) = Sep.opt_space . del pat default
let sep = IniFile.sep /=[ \t]*/ "="
An IniFile.sep entry
let sep = IniFile.sep "=" "="
let sep_ace = IniFile.sep IniFile.sep_re IniFile.sep_default
let sep_acf = IniFile.sep IniFile.sep_re IniFile.sep_default
let sep_ade = IniFile.sep IniFile.sep_re IniFile.sep_default
let sep_adf = IniFile.sep IniFile.sep_re IniFile.sep_default
let sep_bce = IniFile.sep "=" "="
let sep_bcf = IniFile.sep "=" "="
let sep_bde = IniFile.sep "=" "="
let sep_bdf = IniFile.sep "=" "="
let sep_col = sep_cont_opt . Util.del_str ":" . sep_cont_opt
The separator for database entries
let sep_colon = del /:[ \t]*/ ": "
The separator for key/value entries
let sep_colon = del /:[ \t]*/ ": "
let sep_com = sep_cont_opt . Util.del_str "," . sep_cont_opt
let sep_cont = del /([ \t]+|[ \t]*\\\\\n[ \t]*)/ " "
let sep_cont_opt = del /([ \t]*|[ \t]*\\\\\n[ \t]*)/ " "
The default separator value
let sep_default = "="
let sep_dquot = Util.del_str "\""
let sep_dquote = Util.del_str "\""
let sep_dquote = Util.del_str "\""
let sep_eq = Util.del_str "="
let sep_eq = sep_cont_opt . Util.del_str "=" . sep_cont_opt
The separator of directories in a moddir search path
let sep_moddir = del /[: ]+/ " "
let sep_opt_spc = Sep.opt_space
The default regexp for a separator
let sep_re = /[=:]/
let sep_space = del /([ \t]|(\\\\\n))+/ " "
let sep_spc = Util.del_ws_spc
let sep_spc = Sep.space
let sep_spc = del /[ \t]+/ " "
let sep_spc = Util.del_ws_spc
let sep_tab = Sep.tab
let sep_tab = del /([ \t]+|[ \t]*\\\\\n[ \t]*)/ "\t"
let sep_tab_opt = del /([ \t]*|[ \t]*\\\\\n[ \t]*)/ ""
let serial = [ command "serial" "" . [ spc . switch_arg /unit|port|speed|word|parity|stop|device/ ]* . eol ]
The service specification like `files’, `db’, or `nis’
let service = [ label "service" . store Rx.word ]
It is much faster to combine, for example, all the attr_one attributes into one regexp and pass that to a lens instead of using lens union (attr_one “a” | attr_one “b”|..)
let service_attr = attr_one ("socket_type" | "protocol" | "wait" | "user" | "group" |"server" | "instances" | "rpc_version" | "rpc_number" | "id" | "port" | "nice" | "banner" | "bind" | "interface" | "per_source" | "groups" | "banner_success" | "banner_fail" | "disable" | "max_load" | "rlimit_as" | "rlimit_cpu" | "rlimit_data" | "rlimit_rss" | "rlimit_stack" | "v6only" | "deny_time" | "umask" | "mdns" | "libwrap")
Valid set operators: equals, bitwise AND and OR
let set_operators = /[=&|]/
let set_sep_spc = Util.del_opt_ws " "
Sets an integer value or char pointer
let set_value = [ label "value" . store Rx.no_spaces ]
Loads the variable name from a set command, no module
let set_var = [ label "variable" . store Rx.word ]
let shell_command = [ label "shell_command" . sto_to_eol ]
A shell variable in crontab
let shellvar = let key_re = Shellvars.key_re - "entry" in let sto_to_eol = store /[^\n]*[^ \t\n]/ in [ key key_re . sep_eq . sto_to_eol . eol ]
A simple configuration file
let simple_config = "# A comment disk_config disk2 raw-disk - 0 - - disk_config lvm vg my_pv sda2 vg test disk1.9 my_pv-_swap swap 2048 swap sw my_pv-_root / 2048 ext3 rw,errors=remount-ro disk_config raid raid1 /boot disk1.1,disk2.1,disk3.1,disk4.1,disk5.1,disk6.1 ext3 rw raid1 swap disk1.2,disk2.2,disk3.2,disk4.2,disk5.2,disk6.2 swap sw raid5 /srv/data disk1.11,disk2.11,disk3.11,disk4.11,disk5.11,disk6.11 ext3 ro createopts=\"-m 0\" raid0 - disk2.2,sdc1,sde1:spare:missing ext2 default disk_config tmpfs tmpfs /var/opt/hosting/tmp 500 defaults "
let size = [ label "size" . store size_kw . resize? ]
Regexps for size
let size_kw = /[0-9]+[kMGTP%]?(-([0-9]+[kMGTP%]?)?)?/ | /-[0-9]+[kMGTP%]?/
let softdep = let premod = [ label "pre" . sep_space . sto_no_colons ] in let pre = sep_space . Util.del_str "pre:" . premod+ in let postmod = [ label "post" . sep_space . sto_no_colons ] in let post = sep_space . Util.del_str "post:" . postmod+ in [ key "softdep" . sep_space . sto_no_colons . pre? . post? . Util.comment_or_eol ]
let sortlist = Build.key_value_line_comment "sortlist" Sep.space (Build.opt_list ipaddr Sep.space) comment_eol
let space = Sep.space
A mandatory space or tab
let space = /[ \t]+/
Deletes a Rx.space and default to a single space
let space = del Rx.space " "
A string which not starting or ending with a space
let space_in = /[^ \t\n].*[^ \t\n]|[^ \t\n]/
let spare_missing = tag /spare|missing/
let spc = Util.del_ws_spc
A user specification, listing colon-separated spec_lists
let spec = [ label "spec" . indent . alias_list "user" sto_to_com_user . sep_cont . spec_list . ( sep_col . spec_list )* . comment_or_eol ]
Group of hosts with cmnd_spec_list
let spec_list = [ label "host_group" . alias_list "host" sto_to_com_host . sep_eq . cmnd_spec_list ]
The whole string is fed to ip addr add.
let static_ipaddress_field = [ indent . ipaddr . (sep_spc . ipdev)? . comment_or_eol ]
let static_routes = block "static_ipaddress" static_ipaddress_field | block "static_routes" static_routes_field
src $SRC_IP to $DST_IP dev $SRC_DEVICE
let static_routes_field = [ indent . label "route" . [ key "src" . sto_word ] . sep_spc . [ key "to" . sto_word ] . sep_spc . [ key "dev" . sto_word ] . comment_or_eol ]
Exclusion for files that are commonly not wanted/needed
let stdexcl = (excl "*~") . (excl "*.rpmnew") . (excl "*.rpmsave") . (excl "*.dpkg-old") . (excl "*.dpkg-new") . (excl "*.dpkg-bak") . (excl "*.dpkg-dist") . (excl "*.augsave") . (excl "*.augnew")
Store a boolean value
let sto_bool = store ("on"|"off")
Store a boolean value
let sto_bool_warn = store ("on"|"off"|"warn"|"nowarn")
let sto_email_addr = store Rx.email_addr
let sto_integer = store /[0-9]+/
let sto_no_colons = store /[^:# \t\n\\\\]+/
let sto_no_spaces = store /[^# \t\n\\\\]+/
let sto_num = store Rx.relinteger
There could be a \ in the middle of a command
let sto_to_com = store /([^,=:#() \t\n\\][^,=:#()\n]*[^,=:#() \t\n\\])|[^,=:#() \t\n\\]/
sto_to_com_cmnd does not begin or end with a space
let sto_to_com_cmnd = store /([^,=:#() \t\n\\]([^,=:#()\n\\]|\\\\[=:,\\])*[^,=:#() \t\n\\])|[^,=:#() \t\n\\]/
let sto_to_com_col = store /[^",=#() \t\n\\]+/ (* " relax emacs *)
let sto_to_com_host = store /[^,=:#() \t\n\\]+/
Escaped spaces are allowed
let sto_to_com_user = store ( /([^,=:#() \t\n]([^,=:#() \t\n]|(\\\\[ \t]))*[^,=:#() \t\n])|[^,=:#() \t\n]/ - /(User|Runas|Host|Cmnd)_Alias|Defaults.*/ )
Store until comment
let sto_to_comment = Sep.opt_space . store /[^# \t\n][^#\n]*[^# \t\n]|[^# \t\n]/
Store until comment
let sto_to_comment = Sep.opt_space . store to_comment_re
let sto_to_eol = store /[^ \t\n:][^\n]*[^ \t\n]|[^ \t\n:]/
Store until end of line
let sto_to_eol = Sep.opt_space . store Rx.space_in
let sto_to_eol = store /[^#! \t\n][^#!\n]*[^#! \t\n]|[^#! \t\n]/
let sto_to_eol = store /[^# \t\n\\\\][^#\n\\\\]*[^# \t\n\\\\]|[^# \t\n\\\\]/
let sto_to_eq = store /[^,=:#() \t\n\\]+/
let sto_to_spc = store /[^", \t\n\\]+|"[^", \t\n\\]+"/
let sto_to_spc_no_dquote = store /[^",# \t\n\\]+/ (* " relax emacs *)
let sto_word = store word
let switch (n:regexp) = dels "--" . key n
let switch_arg (n:regexp) = switch n . eq . store Rx.no_spaces