feat: use libmacchina package count for Windows and BSD

This commit is contained in:
Adrian Groh 2023-02-24 20:03:45 +01:00
parent 1af90da83e
commit 39785f1911
Signed by: Gobidev
GPG Key ID: 3AA3153E98B0D771

View File

@ -100,17 +100,7 @@ pub fn total_packages(package_readout: &PackageReadout, skip_slow: bool) -> usiz
.map(|mngr| packages(mngr, &macchina_package_count, skip_slow)) .map(|mngr| packages(mngr, &macchina_package_count, skip_slow))
.sum() .sum()
} }
"macos" => package_readout.count_pkgs().iter().map(|elem| elem.1).sum(), _ => package_readout.count_pkgs().iter().map(|elem| elem.1).sum(),
"freebsd" | "dragonfly" => run_and_count_lines("pkg", &["info"]),
"openbsd" => match glob("/var/db/pkg/*/") {
Ok(files) => files.count(),
Err(_) => 0,
},
"netbsd" => run_and_count_lines("pkg_info", &[]),
"solaris" => {
run_and_count_lines("pkginfo", &["-i"]) + run_and_count_lines("pkg", &["list"])
}
_ => 0,
} }
} }