Returns whether a package is currently installed according to `dpkg`.
(package: &str)
| 89 | |
| 90 | /// Returns whether a package is currently installed according to `dpkg`. |
| 91 | pub fn is_package_installed(package: &str) -> bool { |
| 92 | Command::new("dpkg") |
| 93 | .args(["-s", package]) |
| 94 | .output() |
| 95 | .is_ok_and(|output| output.status.success()) |
| 96 | } |
| 97 | |
| 98 | pub fn install(system_info: &SystemInfo, packages: &[&str]) -> Result<()> { |
| 99 | if !is_system_compatible(system_info) { |
no test coverage detected