Crate apt_sources

Source
Expand description

A library for parsing and manipulating APT source files that use the DEB822 format to hold package repositories specifications.

Currently only lossy serialization is implemented, lossless support retaining file sequence and comments would come at later date.

§Examples


use apt_sources::Repositories;
use std::path::Path;

let text = r#"Types: deb
URIs: http://ports.ubuntu.com/
Suites: noble
Components: stable
Architectures: arm64
Signed-By:
 -----BEGIN PGP PUBLIC KEY BLOCK-----
 .
 mDMEY865UxYJKwYBBAHaRw8BAQdAd7Z0srwuhlB6JKFkcf4HU4SSS/xcRfwEQWzr
 crf6AEq0SURlYmlhbiBTdGFibGUgUmVsZWFzZSBLZXkgKDEyL2Jvb2t3b3JtKSA8
 ZGViaWFuLXJlbGVhc2VAbGlzdHMuZGViaWFuLm9yZz6IlgQTFggAPhYhBE1k/sEZ
 wgKQZ9bnkfjSWFuHg9SBBQJjzrlTAhsDBQkPCZwABQsJCAcCBhUKCQgLAgQWAgMB
 Ah4BAheAAAoJEPjSWFuHg9SBSgwBAP9qpeO5z1s5m4D4z3TcqDo1wez6DNya27QW
 WoG/4oBsAQCEN8Z00DXagPHbwrvsY2t9BCsT+PgnSn9biobwX7bDDg==
 =5NZE
 -----END PGP PUBLIC KEY BLOCK-----"#;

let r = text.parse::<Repositories>().unwrap();
let suites = r[0].suites();
assert_eq!(suites[0], "noble");

Modules§

error
A module for handling errors in apt-sources crate of deb822-rs project. It intends to address error handling in meaningful manner, less vague than just passing String as error.
signature
A module implementing Signature type that holds info about variants of the signature key used by the repository

Structs§

Repositories
Container for multiple Repository specifications as single .sources file may contain as per specification
Repository
A structure representing APT repository as declared by DEB822 source file

Enums§

RepositoryType
A representation of the repository type, by role of packages it can provide, either Binary (indicated by deb) or Source (indicated by deb-src).
YesNoForce
Enumeration for fields like By-Hash which have third value of force