Index

B |
| BackupPCHosts
| bang, Syslog
| bare, Erlang
| base definitions, Toml
| Base entry, Nslcd
| BASIC ATTRIBUTES, Ldif
| basic tokens, Aliases
| bcast, Chrony
| bind_entry, Redis
| blacklist, Modprobe
| blank_val ActiveMQ_Conf OpenShift_Config
| block Build Dovecot Keepalived Nginx Test_Build
| BLOCK CONSTRUCTIONS Build Test_Build
| block_entry, Test_Build
| block_generic, Build
| block_ldelim_default, Build
| block_ldelim_newlines_default Build Trapperkeeper
| block_ldelim_newlines_re Build Trapperkeeper
| block_ldelim_re, Build
| block_names, Dovecot
| block_newline Build Trapperkeeper
| block_newlines_spc, Build
| block_rdelim_default, Build
| block_rdelim_newlines_default Build Trapperkeeper
| block_rdelim_newlines_re Build Trapperkeeper
| block_rdelim_re, Build
| block_re, Nginx
| block_setdefault, Build
| body, Xinetd
| bool Host_Conf UpdateDB
| bool_warn, Host_Conf
| boolean, Erlang
| boot BootConf Grub
| BOOT ENTRIES, Grub
| boot_entry, Grub
| boot_error, Grub
| boot_setting, Grub
| BootConf
| brackets Build Test_Build
| Build
| by, Reprepro_Uploaders
| by_group, Reprepro_Uploaders
| by_key, Reprepro_Uploaders
| byte, Rx

Parses /etc/backuppc/hosts

> let bang = Util.del_str "!"

Deletes a bang and default to it

> let bare = store Rx.word

Store a bare Rx.word

> let bcast = [ Util.indent . key "broadcast" . space . [ label "interval" . store integer ] . space . store_address . ( space . [ label "port" . store integer ] )? . eol ]

broadcast has specific syntax

> let bind_entry = let ip = del_ws_spc . Quote.do_quote_opt_nil (store Rx.ip) in indent . [ key "bind" . [ label "ip" . ip ]+ ] . eol

The “bind” entry can be passed one or several ip addresses.

> let blacklist = Build.key_value_line_comment "blacklist" sep_space sto_no_spaces comment

> let blank_val = del /^\z/

> let blank_val = del /["']{2}/ "\"\""

> let block (entry:lens) = block_setdelim entry block_ldelim_re block_rdelim_re block_ldelim_default block_rdelim_default

A block enclosed in brackets

> let rec block = [ indent . key block_names . (Sep.space . Quote.do_dquote_opt (store /!?[\/A-Za-z0-9_-]+/))? . block_newlines (entry|block|mailbox) comment . eol ]

Map block enclosed in brackets recursively.

> let block (kw:regexp) (sto:lens) = lens_block (key kw) sto

A simple block with just a block title

> let block (entry : lens) = [ Util.indent . block_head . Build.block_newlines entry Util.comment . Util.eol ]

A block containing simple entries

> let block = Build.block block_entry

The block used for testing

> let block_entry = Build.key_value "test" Sep.equal (store Rx.word)

The block entry used for testing

> let block_generic (entry:lens) (entry_noindent:lens) (entry_noeol:lens) (entry_noindent_noeol:lens) (comment:lens) (comment_noindent:lens) (ldelim_re:regexp) (rdelim_re:regexp) (ldelim_default:string) (rdelim_default:string) = let block_single = entry_noindent_noeol | comment_noindent in let block_start = entry_noindent | comment_noindent in let block_middle = (entry | comment)* in let block_end = entry_noeol | comment in del ldelim_re ldelim_default . ( ( block_start . block_middle . block_end ) | block_single ) . del rdelim_re rdelim_default

A block enclosed in brackets

> let block_names = /dict|userdb|passdb|protocol|service|plugin|namespace|map|fields|unix_listener|fifo_listener|inet_listener/

> let block_newlines (entry:lens) (comment:lens) = del block_ldelim_newlines_re block_ldelim_newlines_default . ((entry | comment) . (Util.empty | entry | comment)*)? . del block_rdelim_newlines_re block_rdelim_newlines_default

A block enclosed in brackets, with newlines forced and indentation defaulting to a tab.

> let block_newlines (entry:lens) (comment:lens) = del block_ldelim_newlines_re block_ldelim_newlines_default . ((entry | comment) . (Util.empty | entry | comment)*)? . del block_rdelim_newlines_re block_rdelim_newlines_default

A block enclosed in brackets, with newlines forced and indentation defaulting to a tab.

> let block_newlines_spc (entry:lens) (comment:lens) = del (/[ \t\n]/ . block_ldelim_newlines_re) block_ldelim_newlines_default . ((entry | comment) . (Util.empty | entry | comment)*)? . del block_rdelim_newlines_re block_rdelim_newlines_default

A block enclosed in brackets, with newlines forced and indentation defaulting to a tab.

> let block_rdelim_default = "}"

> let block_rdelim_newlines_default = "}"

> let block_rdelim_newlines_default = "}"

> let block_rdelim_newlines_re = /[ \t]*\}/

> let block_rdelim_newlines_re = /[ \t]*\}/

> let block_rdelim_re = /[ \t\n]*\}/

> let block_re = "http" | "events" | "server" | "mail" | "stream"

The keywords reserved for block entries
A block enclosed in brackets

> let body (attr:lens) = Build.block_newlines_spc (indent . attr . Util.eol) Util.comment

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 bool (kw:regexp) = Build.key_value_line kw Sep.space sto_bool

A boolean switch

> let bool = [ key "PRUNE_BIND_MOUNTS" . Sep.space_equal . Quote.do_dquote (store /[01]|no|yes/) . Util.doseol ]

A boolean entry

> let bool_warn (kw:regexp) = Build.key_value_line kw Sep.space sto_bool_warn

A boolean switch with extended values

> let boolean = store /true|false/

Store a boolean value

> let boot = let image = [ label "image" . store fspath ] in let arg = [ label "arg" . store word ] in Build.key_value_line "boot" space (image . space . arg)

boot [image [-acds]] XXX: the last arguments are not always needed, so make them optional

> let boot = let line = ((boot_setting|comment)* . boot_setting)? in [ label "title" . title . line ]

> let boot_entry = let boot_arg_re = "root" | "initrd" | "rootnoverify" | "uuid" | "findroot" | "bootfs" (* Solaris extensions *) in kw_boot_arg boot_arg_re | kernel | chainloader | kw_pres "quiet" (* Seems to be a Ubuntu extension *) | savedefault | configfile | module_line | map_line | kw_pres "lock" | kw_pres "makeactive" | password_arg

boot entries

> let boot_error = let kw = /lock|uuid|password|root|initrd|rootnoverify|findroot|bootfs/ |/configfile|chainloader|title|boot|quiet|kernel|

Accept lines not matching boot_entry and stuff them into ‘#error’ nodes

> let boot_setting = boot_entry | boot_error

a valid boot setting or a line that looks like one but is an #error
Parses (Open)BSD-stype /etc/boot.conf

> let brackets (l:lens) (r:lens) (lns:lens) = l . lns . r

Put a lens inside brackets

> let brackets = [ Build.brackets Sep.lbracket Sep.rbracket (key Rx.word) ]

Test brackets
Generic functions to build lenses

> let by = [ key "by" . Sep.space . ( store ("anybody"|"unsigned") | by_key | by_group ) ]

by statements define who is allowed to upload.

> let by_group = value "group" . [ key "group" . Sep.space . store Rx.word ]

Authenticate packages by a groupname.

> 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)

When a key is used to authenticate packages, the value can either be a key ID or “any”:

> let byte = /25[0-5]?|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9]/

Close