Crate debian_control

Source
Expand description

Parser for Debian control files.

This crate provides a parser for Debian control files.

§Example

use debian_control::lossy::Control;
use debian_control::fields::Priority;
use std::fs::File;

let mut control = Control::new();
let mut source = &mut control.source;
source.name = "hello".to_string();
source.section = Some("rust".to_string());

let mut binary = control.add_binary("hello");
binary.architecture = Some("amd64".to_string());
binary.priority = Some(Priority::Optional);
binary.description = Some("Hello, world!".to_string());

assert_eq!(control.to_string(), r#"Source: hello
Section: rust

Package: hello
Architecture: amd64
Priority: optional
Description: Hello, world!
"#);

See the lossless module for a parser that preserves all comments and formatting, and as well as allowing inline errors.

Re-exports§

pub use lossless::control::Binary;
pub use lossless::control::Control;
pub use lossless::control::Source;
pub use lossless::apt;
pub use lossless::changes;
pub use lossless::control;
pub use fields::*;

Modules§

fields
Fields for the control file
lossless
Lossless parser for various Debian control files
lossy
Lossy parsing of Debian control files
pgp
PGP signature parsing.
relations
Parsing of Debian relations strings.
vcs
Version Control System information

Enums§

ParseIdentityError
Error type for parsing an identity string.

Traits§

VersionLookup
A trait for looking up versions of packages.

Functions§

parse_identity
Parse an identity string into a name and an email address.