8 releases

0.1.8 Feb 22, 2024
0.1.7 Nov 29, 2023
0.1.4 Oct 28, 2023
0.1.1 Jun 16, 2023

#604 in Unix APIs

Download history 117/week @ 2024-01-08 123/week @ 2024-01-15 539/week @ 2024-01-22 142/week @ 2024-01-29 446/week @ 2024-02-05 338/week @ 2024-02-12 330/week @ 2024-02-19 255/week @ 2024-02-26 939/week @ 2024-03-04 182/week @ 2024-03-11 355/week @ 2024-03-18 648/week @ 2024-03-25 1426/week @ 2024-04-01 458/week @ 2024-04-08 394/week @ 2024-04-15 523/week @ 2024-04-22

2,821 downloads per month
Used in 3 crates (via debian-analyzer)

Apache-2.0

84KB
2K SLoC

Lossless parser for Debian Control files

This crate contains a lossless parser for Debian control files.


lib.rs:

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.

Example

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!
"#);

Dependencies

~4.5–7MB
~151K SLoC