A Rust library to parse and search the Gentoo Linux Portage Package Manager eix database format.
use eix::{Database, PackageReader};
fn main() -> std::io::Result<()> {
let mut db = Database::open_read("/var/cache/eix/portage.eix")?;
let header = db.read_header(0)?;
let mut reader = PackageReader::new(db, header);
while reader.next_category()? {
let category = reader.current_category();
while let Some(pkg) = reader.read_package()? {
println!("{}/{}: {}", category, pkg.name, pkg.description);
}
}
Ok(())
}The library includes an example tool eix2json that converts an eix database to JSON format.
cargo run --example eix2json -- /var/cache/eix/portage.eix output.jsonIf no output file is specified, it will output to stdout.
The example eix_version_masks displays all versions of each package along with their mask flags and other metadata.
cargo run --example eix_version_masks -- /var/cache/eix/portage.eixLicensed 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.