2 unstable releases

0.2.1 Aug 5, 2021
0.2.0 Aug 5, 2021
0.1.0 Oct 3, 2018

#936 in Unix APIs

Download history 1/week @ 2024-03-09 31/week @ 2024-03-30 8/week @ 2024-04-06

56 downloads per month

MIT license

12KB
162 lines

debarchive

This Rust crate provides direct access to files within a Debian archive. This crate is used by our debrep utility to generate the Packages and Contents files for generated apt repositories.

Features

  • Reading files from archives
  • Extracting files from archives
  • Writing new debian archives

Examples

extern crate debarchive;

use debarchive::Archive;
use std::path::Path;

fn main() {
    let path = &Path::new("name_version_arch.deb");
    let archive = Archive::new(path).unwrap();
    archive.data(|entry| {
        if let Ok(path) = entry.path() {
            println!("data: {}", path.display());
        }
    });

    let control_map = archive.control_map().unwrap();
    println!("Control: {:#?}", control_map);
}

lib.rs:

This crate provides direct access to files within a Debian archive.

Features

  • Reading files from archives
  • Extracting files from archives
  • Writing new debian archives

Examples

extern crate debarchive;

use debarchive::Archive;
use std::path::Path;

fn main() {
    let path = &Path::new("name_version_arch.deb");
    let archive = Archive::new(path).unwrap();
    archive.data(|entry| {
        if let Ok(path) = entry.path() {
            println!("data: {}", path.display());
        }
    });

    let control_map = archive.control_map().unwrap();
    println!("Control: {:#?}", control_map);
}

Dependencies

~6–15MB
~199K SLoC