pub struct Repository {Show 17 fields
pub enabled: Option<bool>,
pub types: HashSet<RepositoryType>,
pub uris: Vec<Url>,
pub suites: Vec<String>,
pub components: Option<Vec<String>>,
pub architectures: Vec<String>,
pub languages: Option<Vec<String>>,
pub targets: Option<Vec<String>>,
pub pdiffs: Option<bool>,
pub by_hash: Option<YesNoForce>,
pub allow_insecure: Option<bool>,
pub allow_weak: Option<bool>,
pub allow_downgrade_to_insecure: Option<bool>,
pub trusted: Option<bool>,
pub signature: Option<Signature>,
pub x_repolib_name: Option<String>,
pub description: Option<String>,
}Expand description
A structure representing APT repository as declared by DEB822 source file
According to sources.list(5) man pages, only four fields are mandatory:
Typeseitherdebor/anddeb-srcURIsto repositories holding valid APT structure (unclear if multiple are allowed)Suitesusually being distribution codenamesComponentmost of the timemain, but it’s a section of the repository
The manpage specifies following optional fields
Enabledis a yes/no field, default yesArchitecturesLanguagesTargetsPDiffsis a yes/no fieldBy-Hashis a yes/no/force fieldAllow-Insecureis a yes/no field, default noAllow-Weakis a yes/no field, default noAllow-Downgrade-To-Insecureis a yes/no field, default noTrustedus a yes/no fieldSigned-Byis either path to the key or PGP key blockCheck-Valid-Untilis a yes/no fieldValid-Until-MinValid-Until-MaxCheck-Dateis a yes/no fieldDate-Max-FutureInRelease-Pathrelative pathSnapshoteitherenableor a snapshot ID
The unit tests of APT use:
Description
The RepoLib tool uses:
X-Repolib-Nameidentifier for own reference, meaningless for APT
Note: Multivalues *-Add & *-Remove semantics aren’t supported.
Fields§
§enabled: Option<bool>If no (false) the repository is ignored by APT
types: HashSet<RepositoryType>The value RepositoryType::Binary (deb) or/and RepositoryType::Source (deb-src)
uris: Vec<Url>The address of the repository
suites: Vec<String>The distribution name as codename or suite type (like stable or testing)
components: Option<Vec<String>>(Optional) Section of the repository, usually main, contrib or non-free
return None if repository is Flat Repository Format (https://wiki.debian.org/DebianRepository/Format#Flat_Repository_Format)
architectures: Vec<String>(Optional) Architectures binaries from this repository run on
languages: Option<Vec<String>>(Optional) Translations support to download
targets: Option<Vec<String>>(Optional) Download targets to acquire from this source
pdiffs: Option<bool>(Optional) Controls if APT should try PDiffs instead of downloading indexes entirely; if not set defaults to configuration option Acquire::PDiffs
by_hash: Option<YesNoForce>(Optional) Controls if APT should try to acquire indexes via a URI constructed from a hashsum of the expected file
allow_insecure: Option<bool>(Optional) If yes circumvents parts of apt-secure, don’t thread lightly
allow_weak: Option<bool>(Optional) If yes circumvents parts of apt-secure, don’t thread lightly
allow_downgrade_to_insecure: Option<bool>(Optional) If yes circumvents parts of apt-secure, don’t thread lightly
trusted: Option<bool>(Optional) If set forces whether APT considers source as rusted or no (default not present is a third state)
signature: Option<Signature>(Optional) Contains either absolute path to GPG keyring or embedded GPG public key block, if not set APT uses all trusted keys; I can’t find example of using with fingerprints
x_repolib_name: Option<String>(Optional) Field ignored by APT but used by RepoLib to identify repositories, Ubuntu sources contain them
description: Option<String>(Optional) Field not present in the man page, but used in APT unit tests, potentially to hold the repository description
Implementations§
Source§impl Repository
impl Repository
Sourcepub fn suites(&self) -> &[String]
pub fn suites(&self) -> &[String]
Returns slice of strings containing suites for which this repository provides
Sourcepub fn types(&self) -> &HashSet<RepositoryType>
pub fn types(&self) -> &HashSet<RepositoryType>
Returns the repository types (deb/deb-src)
Sourcepub fn components(&self) -> Option<&[String]>
pub fn components(&self) -> Option<&[String]>
Returns the repository components
Sourcepub fn architectures(&self) -> &[String]
pub fn architectures(&self) -> &[String]
Returns the repository architectures
Sourcepub fn to_legacy_format(&self) -> String
pub fn to_legacy_format(&self) -> String
Generate legacy .list format lines for this repository
Sourcepub fn parse_legacy_line(line: &str) -> Result<Repository, String>
pub fn parse_legacy_line(line: &str) -> Result<Repository, String>
Parse a legacy apt sources.list line (e.g., “deb http://example.com/debian stable main”)
Trait Implementations§
Source§impl Clone for Repository
impl Clone for Repository
Source§fn clone(&self) -> Repository
fn clone(&self) -> Repository
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more