debian-control

Crates.iodebian-control
lib.rsdebian-control
version
sourcesrc
created_at2023-06-16 00:05:28.813207
updated_at2024-11-16 11:39:02.776971
descriptionA parser for Debian copyright files
homepagehttps://github.com/jelmer/deb822-lossless
repositoryhttps://github.com/jelmer/deb822-lossless
max_upload_size
id891666
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Jelmer Vernooij (jelmer)

documentation

README

Lossless parser for Debian Control files

This crate provides a parser for Debian control files. It is lossless, meaning that it will preserve the original formatting of the file. It also provides a way to serialize the parsed data back to a string.

use debian_control::{Control, Priority};
use std::fs::File;

let mut control = Control::new();
let mut source = control.add_source("hello");
source.set_section("rust");

let mut binary = control.add_binary("hello");
binary.set_architecture("amd64");
binary.set_priority(Priority::Optional);
binary.set_description("Hello, world!");

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

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

cargo fmt