D | |
daemon, Hosts_Access | |
daemon_list, Hosts_Access | |
database | |
database_kw, Nsswitch | |
dayofmonth, Cron | |
dayofweek, Cron | |
debian, Grub | |
debian_comment, Grub | |
debian_comment_re, Grub | |
debian_entry, Grub | |
debian_footer, Grub | |
debian_header, Grub | |
debian_setting_re, Grub | |
decimal, Erlang | |
def, LVM | |
default_depth, Xorg | |
default_type, Sudoers | |
defaults | |
defaults_entry, Mke2fs | |
defaults_title, Mke2fs | |
del_negate, Sudoers | |
del_to_eol, Grub | |
delay, Anacron | |
delim, Util | |
dels, Grub | |
description, Schroot | |
destination | |
device | |
device_re, Ntpd | |
disk_free_limit, Rabbitmq | |
display, Xorg | |
display_entry, Xorg | |
display_modes, Xorg | |
dn, Automaster | |
do_dquote, Quote | |
do_dquote_opt, Quote | |
do_dquote_opt_nil, Quote | |
do_quote, Quote | |
do_squote, Quote | |
do_squote_opt, Quote | |
do_squote_opt_nil, Quote | |
domain, Resolv | |
double | |
double_opt | |
double_opt_allow_spc, Test_Quote | |
dquote_opt_nil, Test_Quote | |
dquote_spaces | |
driver, Xorg | |
duration, Xymon_Alerting |
let daemon = let host = [ label "host" . Util.del_str "@" . list_item ] in [ label "process" . list_item . host? ]
A list of daemons
let daemon_list = Build.opt_list daemon list_sep
let database = [ label "database" . store database_kw . sep_colon . (Build.opt_list (service|reaction) Sep.space) . Util.eol ]
TODO: support for quoted strings
let database = comma_sep_list "database"
The database specification like `passwd’, `shadow’, or `hosts’
let database_kw = Rx.word
let dayofmonth = [ label "dayofmonth" . store num ]
let dayofweek = [ label "dayofweek" . store alphanum ]
A debian-specific section, made of debian_entry lines
let debian = [ label "debian" . del debian_header debian_header . (debian_comment|empty|debian_entry)* . del debian_footer debian_footer ]
A comment entry inside a debian-specific section
let debian_comment = [ Util.indent . label "#comment" . del /##[ \t]*/ "## " . store debian_comment_re . eol ]
let debian_comment_re = /([^ \t\n].*[^ \t\n]|[^ \t\n])/ - "## End Default Options ##"
let debian_entry = [ Util.del_str "#" . Util.indent . key debian_setting_re . del /[ \t]*=/ "=" . value_to_eol? . eol ]
Footer for a debian-specific section
let debian_footer = "## ## End Default Options ##\n"
Header for a debian-specific section
let debian_header = "## ## Start Default Options ##\n"
let debian_setting_re = "kopt" | "groot" | "alternative" | "lockalternative" | "defoptions" | "lockold" | "xenhopt" | "xenkopt" | "altoptions" | "howmany" | "memtest86" | "updatedefaultentry" | "savedefault" | "indomU"
Store a decimal value
let decimal = store /[0-9]+(.[0-9]+)?/
let default_depth = entry_int "DefaultDepth" /[dD]efault[dD]epth/
Type definition for defaults
let default_type = let value = store /[@:!>][^ \t\n\\]+/ in [ label "type" . value ]
A defaults section
let defaults = IniFile.record defaults_title ((Util.indent . (defaults_entry|common_entry)) | comment)
A Defaults entry
let defaults = [ indent . key "Defaults" . default_type? . sep_cont . parameter_list . comment_or_eol ]
Possible entries under the defaults section
let defaults_entry = entry_sto "force_undo" ("true"|"false") | entry_sto "fs_type" Rx.word | entry_sto "undo_dir" Rx.fspath | list_sto "default_mntopts" (key Rx.word) | entry_sto "enable_periodic_fsck" Rx.integer
Title for the defaults section
let defaults_title = IniFile.title "defaults"
Delete an even number of ‘!’
let del_negate = del /(!!)*/ ""
let del_to_eol = del /[^ \t\n]*/ ""
The delay for an entry
let delay = [ label "delay" . store Rx.integer ]
let delim (op:string) = del (/[ \t]*/ . op . /[ \t]*/) (" " . op . " ")
let dels (s:string) = Util.del_str s
Descriptions are special entries, which can have an optional lang parameter
let description = let lang = [ Util.del_str "[" . label "lang" . store IniFile.entry_re . Util.del_str "]" ] in IniFile.entry_generic_nocomment (key "description" . lang?) sep "#" comment
Can be either a word (no spaces included) or a command with spaces
let destination = ( word | command )
let destination = [ label "destination" . word ]
This is a shell-only directive in upstream grub; the grub versions in at least Fedora/RHEL use this to find devices for UEFI boot
let device = [ command "device" "" . Sep.space . store /\([A-Za-z0-9_.-]+\)/ . spc . [ label "file" . value_to_eol ] . Util.eol ]
let device = entry_str "Device" /[dD]evice/
let device_re = Rx.device_name | /\*/
let disk_free_limit = let value = Erlang.integer | Erlang.tuple Erlang.bare Erlang.decimal in Erlang.value "disk_free_limit" value
let display = [ indent . del "SubSection" "SubSection" . sep_spc . sep_dquote . key "Display" . sep_dquote . eol . display_entry* . indent . del "EndSubSection" "EndSubSection" . eol ]
Known values for entries in the Display subsection
let display_entry = entry_int "Depth" /[dD]epth/ | entry_int "FbBpp" /[fF]b[bB]pp/ | entry_rgb "Weight" /[wW]eight/ | entry_xy "Virtual" /[vV]irtual/ | entry_xy "ViewPort" /[vV]iew[pP]ort/ | display_modes | entry_str "Visual" /[vV]isual/ | entry_rgb "Black" /[bB]lack/ | entry_rgb "White" /[wW]hite/ | entry_str "Options" /[oO]ptions/ | empty | comment
let display_modes = [ indent . del /[mM]odes/ "Modes" . label "Modes" . [ label "mode" . sep_spc . quoted_string_val ]+ . eol ]
let dn = /[^:# \n\t]+/
Enclose a lens in dquotes
let do_dquote (body:lens) = square dquote body dquote
Enclose a lens in optional dquotes, use dquotes by default.
let do_dquote_opt (body:lens) = square dquote_opt body dquote_opt
Enclose a lens in optional dquotes, default to no quotes.
let do_dquote_opt_nil (body:lens) = square dquote_opt_nil body dquote_opt_nil
Enclose a lens in quotes.
let do_quote (body:lens) = square quote body quote
Enclose a lens in squotes
let do_squote (body:lens) = square squote body squote
Enclose a lens in optional squotes, use squotes by default.
let do_squote_opt (body:lens) = square squote_opt body squote_opt
Enclose a lens in optional squotes, default to no quotes.
let do_squote_opt_nil (body:lens) = square squote_opt_nil body squote_opt_nil
let domain = Build.key_value_line_comment "domain" Sep.space (store Rx.word) comment_eol
A double-quoted value
let double = let body = store /[^\n]*/ in do_dquote body
let double = [ label "double" . Quote.double ]
An optionaly double-quoted value Double quotes are not allowed in value Value cannot begin or end with spaces
let double_opt = let body = store double_opt_re in do_dquote_opt body
let double_opt = [ label "double_opt" . Quote.double_opt ]
let double_opt_allow_spc = let body = store /[^\n"]+/ in [ label "double" . Quote.do_dquote_opt body ]
let dquote_opt_nil = let body = store Quote.double_opt_re in [ label "dquote_opt_nil" . Quote.do_dquote_opt_nil body ]?
Make double quotes mandatory if value contains spaces, and optional if value doesn’t contain spaces.
let dquote_spaces (lns1:lens) (lns2:lens) =
Make double quotes mandatory if value contains spaces, and optional if value doesn’t contain spaces.
let dquote_spaces (lns:lens) =
let driver = entry_str "Driver" /[dD]river/
The duration filter definition
let duration = [ key "DURATION" . [ label "operator" . comparison ] . [ label "value" . store_word ] ]