6 releases (breaking)

0.6.0 May 25, 2022
0.5.0 Mar 20, 2021
0.4.0 Jan 2, 2020
0.3.0 Dec 15, 2019
0.1.0 Nov 19, 2019

#912 in Unix APIs

Download history 1995/week @ 2024-07-20 2024/week @ 2024-07-27 2021/week @ 2024-08-03 2207/week @ 2024-08-10 2026/week @ 2024-08-17 2022/week @ 2024-08-24 2690/week @ 2024-08-31 2415/week @ 2024-09-07 2325/week @ 2024-09-14 2126/week @ 2024-09-21 1950/week @ 2024-09-28 1880/week @ 2024-10-05 2012/week @ 2024-10-12 1839/week @ 2024-10-19 1775/week @ 2024-10-26 1700/week @ 2024-11-02

7,601 downloads per month
Used in 4 crates (2 directly)

MIT license

120KB
562 lines

Contains (debian package, 83KB) tests/debs/xz-utils_5.2.4-1_amd64.deb, (debian package, 23KB) tests/debs/libgssglue1_0.3-4_amd64.deb

DebPkg

Actions Status Rust Docs Crates.io Link

A Rust library to parse binary debian packages.

This library provides utilties to parse binary debian packages abstracted over a reader. This API provides a streaming interface to avoid loading the entire debian package into RAM.

This library only parses binary debian packages. It does not attempt to write binary debian packages.

Supported Debian Package Versions

This package only supports version 2.0 of debian packages. Older versions are not currently supported.

Examples

Parsing a debian package

let file = std::fs::File::open("test.deb").unwrap();
let mut pkg = debpkg::DebPkg::parse(file).unwrap();
let mut control_tar = pkg.control().unwrap();
let control = debpkg::Control::extract(control_tar).unwrap();
println!("Package Name: {}", control.name());
println!("Package Version: {}", control.version());
let arch = control.get("Architecture").unwrap();
println!("Package Architecture: {}", arch);

let mut data = pkg.data().unwrap();
let dir = tempfile::TempDir::new().unwrap();
data.unpack(dir).unwrap();

Dependencies

~8–17MB
~240K SLoC