A Rust library to parse and search the Gentoo Linux Portage Package installed database /var/db/pkg.
use vardbpkg::parse_vardb;
use std::path::Path;
fn main() {
let packages = parse_vardb(Path::new("/var/db/pkg"));
for pkg in packages {
println!("{}/{}: {}", pkg.category, pkg.package, pkg.description);
}
}The library includes an example tool vardbpkg2json that converts the Portage database to JSON format.
cargo run --example vardbpkg2json -- /var/db/pkgIf no directory is specified, it defaults to /var/db/pkg.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.