Crates.io | deb-rs |
lib.rs | deb-rs |
version | 0.1.2 |
source | src |
created_at | 2021-01-06 06:16:17.399542 |
updated_at | 2021-01-12 00:42:00.604212 |
description | Extracting and grabbing metadata from .deb files |
homepage | |
repository | |
max_upload_size | |
id | 332895 |
size | 669,471 |
A library for extracting and installing deb files
You can install by adding the folowing to your cargo.toml
file:
deb-rs = "0.1"
You need to have ar
command (part of binutils
) for decompressing the file archive. You also need the tar
command to extract other archives. You need rust nightly to use this package.
Then you can use it in your program:
use std::io::Error;
use deb_rs::file::Deb;
fn main() -> Result<(), Error> {
let mut deb = Deb::new("./example/assets/gnome_clocks.deb");
deb.extract()?;
deb.version()?; // Returns the version of the structure of the debian package.
// NOTE: extract() will fail with versions that are not 2.0 as their structure is different
deb.retrieve_control()?; // Will return some general information about the contents of the package
deb.install_tree()?; // Returns an array of files that must be moved for the file package to work
Ok(())
}