From a8866b9533c32c7284f2205fe42c4e12a7ab3227 Mon Sep 17 00:00:00 2001 From: jLynx Date: Tue, 12 Nov 2024 14:52:55 +1300 Subject: [PATCH] Fixed formatting --- plugins/updater/src/updater.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/updater/src/updater.rs b/plugins/updater/src/updater.rs index 8db0e3f3..64288b44 100644 --- a/plugins/updater/src/updater.rs +++ b/plugins/updater/src/updater.rs @@ -845,19 +845,20 @@ impl Update { fn is_deb_package(&self) -> bool { // First check if we're in a typical Debian installation path - let in_system_path = self.extract_path + let in_system_path = self + .extract_path .to_str() .map(|p| p.starts_with("/usr")) .unwrap_or(false); - + if !in_system_path { return false; } - + // Then verify it's actually a Debian-based system by checking for dpkg let dpkg_exists = std::path::Path::new("/var/lib/dpkg").exists(); let apt_exists = std::path::Path::new("/etc/apt").exists(); - + // Additional check for the package in dpkg database let package_in_dpkg = if let Ok(output) = std::process::Command::new("dpkg") .args(["-S", &self.extract_path.to_string_lossy()]) @@ -867,7 +868,7 @@ impl Update { } else { false }; - + // Consider it a deb package only if: // 1. We're in a system path AND // 2. We have Debian package management tools AND