debpkg

Crates.iodebpkg
lib.rsdebpkg
version0.6.0
sourcesrc
created_at2019-11-19 07:45:23.02302
updated_at2022-05-25 21:46:56.440837
descriptionLibrary for parsing debian packages
homepagehttps://github.com/schultetwin1/debpkg/
repositoryhttps://github.com/schultetwin1/debpkg/
max_upload_size
id182399
size156,877
Matt Schulte (schultetwin1)

documentation

README

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();
Commit count: 107

cargo fmt