apt-pkg-native/examples/list.rs
Chris West (Faux) 4ced3f985c fmt
2017-07-13 22:11:05 +01:00

19 lines
416 B
Rust

extern crate apt_pkg_native;
extern crate itertools;
use itertools::Itertools;
use apt_pkg_native::Cache;
use apt_pkg_native::simple;
fn main() {
let mut cache = Cache::get_singleton();
for item in cache.iter().map(simple::BinaryPackageVersions::new) {
println!(
"{} [{}]",
item.pkg,
item.versions.iter().map(|x| format!("{}", x)).join(", ")
);
}
}