pub fn parse_multi(s: &str) -> Result<Vec<IndexMap<String, Item>>, ParseError>Expand description
Parse multi package: (e.g: /var/lib/dpkg/status)
use std::{fs, io::Read, process::Command};
use eight_deep_parser::{parse_multi, Item};
let dir = fs::read_dir("/var/lib/apt/lists").unwrap();
for i in dir.flatten() {
if !i.file_name().to_str().unwrap().ends_with("_Packages") {
continue;
}
let mut f = std::fs::File::open(i.path()).unwrap();
let mut buf = Vec::new();
f.read_to_end(&mut buf).unwrap();
let r = parse_multi(std::str::from_utf8(&buf).unwrap());
assert!(r.is_ok())
}