3 releases
0.1.2 | Jan 12, 2021 |
---|---|
0.1.1 | Jan 7, 2021 |
0.1.0 | Jan 6, 2021 |
#952 in Unix APIs
45 downloads per month
670KB
387 lines
Contains (debian package, 350KB) example/assets/gnome_clocks.deb, (debian package, 300KB) example/assets/exa.deb
deb-rs
A library for extracting and installing deb files
Requirements for use
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(())
}
lib.rs
:
A library for handling debian files and other tasks related to the debian package
repository. For extracting and retrieving data from .deb
files please go to
file::Deb.
Using this library requires a few common linux packages installed. These are
tar
, mkdir
, and ar
(part of binutils
). Please note there are some issues
with ar
on ubuntu older than 20.04
Dependencies
~6MB
~67K SLoC