apt-pkg-native/examples/list.rs

16 lines
362 B
Rust
Raw Normal View History

2017-07-14 00:01:45 +03:00
use itertools::Itertools;
2017-07-13 16:00:05 +03:00
use apt_pkg_native::simple;
2018-12-17 22:04:09 +03:00
use apt_pkg_native::Cache;
2017-07-13 16:00:05 +03:00
fn main() {
let mut cache = Cache::get_singleton();
for item in cache.iter().map(simple::BinaryPackageVersions::new) {
2017-07-14 00:11:05 +03:00
println!(
"{} [{}]",
item.pkg,
item.versions.iter().map(|x| format!("{}", x)).join(", ")
);
2017-07-13 16:00:05 +03:00
}
}