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 for the control file
- Lossless parser for various Debian control files
- Lossy parsing of Debian control files
- PGP signature parsing.
- Parsing of Debian relations strings.
- Version Control System information
Enums§
- Error type for parsing an identity string.
Traits§
- A trait for looking up versions of packages.
Functions§
- Parse an identity string into a name and an email address.