Augeas module for sources list (Deb822 style) for Apt package manager
James Valleroy jvalleroy@mailbox.org Sunil Mohan Adapa sunil@medhas.org
| Aptsources822 | Augeas module for sources list (Deb822 style) for Apt package manager |
| Reference | https://manpages.debian.org |
| License | This file is licensed under the LGPLv2+, like the rest of Augeas. |
| Configuration files | This lens applies to files in /etc/apt/sources.list.d/ ending with the extension .sources. |
| Augeas Variables | |
| single_value_field_name | Names of known fields for which only a single value is allowed. |
| multi_value_field_name | Names of known fields for which multiple values are allowed and are assumed to contain multiple values These fields also allow the form FieldName-Add: extra_value FieldName-Remove: delete_this_value This is an explicit list of allowed field names |
| field_value | Value that a field can contain. |
| text_value | Value for the embedded public-key format for Signed-By Includes all text on the line except leading-spaces and trailing-spaces |
| empty_line | Lens for an empty line separating two stanzas. |
| name_value_separator | Lens for separating a name and value. |
| single_value_field | Lens for a field (field name, separator and field value) with only a single value. |
| multi_value_field | Lens for a field (field name, separator and field value) with multiple values or can run over multiple lines, ie. |
| stanza | Lens for a stanza that describes one or more sources for apt. |
| lns | Lens for parsing the entire apt sources file in Deb822 format. |
| filter | All files in the sources.list.d directory are files describing sources. |
https://manpages.debian.org
This lens applies to files in /etc/apt/sources.list.d/ ending with the extension .sources. See filter.
let single_value_field_name = /(Enabled|PDiffs|By-Hash|Allow-Insecure|Allow-Weak|Allow-Downgrade-To-Insecure|Trusted|Check-Valid-Until|Valid-Until-Min|Valid-Until-Max|Check-Date|Date-Max-Future|InRelease-Path|Snapshot)/
Names of known fields for which only a single value is allowed.
let multi_value_field_name = /(URIs|Types|Components|Suites|Architectures|Include|Exclude|Languages|Targets|Signed-By)(-Add|-Remove)?/
Names of known fields for which multiple values are allowed and are assumed to contain multiple values These fields also allow the form FieldName-Add: extra_value FieldName-Remove: delete_this_value This is an explicit list of allowed field names
let multi_value_field = [ key multi_value_field_name . name_value_separator . ( ( counter "item" . [ seq "item". store field_value . del /[ \t]+/ " " ]* . [ seq "item". store field_value ] . Util.doseol ) | ( [ label "text" . del "\n" "\n" . counter "item" . [ del /^[ ]/ " " . seq "item" . store text_value . Util.doseol ]+ ] ) ) ]
Lens for a field (field name, separator and field value) with multiple values or can run over multiple lines, ie. SignedBy
Names of known fields for which only a single value is allowed.
let single_value_field_name = /(Enabled|PDiffs|By-Hash|Allow-Insecure|Allow-Weak|Allow-Downgrade-To-Insecure|Trusted|Check-Valid-Until|Valid-Until-Min|Valid-Until-Max|Check-Date|Date-Max-Future|InRelease-Path|Snapshot)/
Names of known fields for which multiple values are allowed and are assumed to contain multiple values These fields also allow the form FieldName-Add: extra_value FieldName-Remove: delete_this_value This is an explicit list of allowed field names
let multi_value_field_name = /(URIs|Types|Components|Suites|Architectures|Include|Exclude|Languages|Targets|Signed-By)(-Add|-Remove)?/
Value that a field can contain.
let field_value = /[!-~]+/
Value for the embedded public-key format for Signed-By Includes all text on the line except leading-spaces and trailing-spaces
let text_value = /[!-~](.*[!-~])?/
Lens for an empty line separating two stanzas.
let empty_line = Util.doseol
Lens for separating a name and value.
let name_value_separator = Sep.colon . del Rx.opt_space " "
Lens for a field (field name, separator and field value) with only a single value.
let single_value_field = [ key single_value_field_name . name_value_separator . store field_value . Util.doseol ]
Lens for a field (field name, separator and field value) with multiple values or can run over multiple lines, ie.
let multi_value_field = [ key multi_value_field_name . name_value_separator . ( ( counter "item" . [ seq "item". store field_value . del /[ \t]+/ " " ]* . [ seq "item". store field_value ] . Util.doseol ) | ( [ label "text" . del "\n" "\n" . counter "item" . [ del /^[ ]/ " " . seq "item" . store text_value . Util.doseol ]+ ] ) ) ]
Lens for parsing the entire apt sources file in Deb822 format.
let lns = ( stanza . empty_line )* . stanza