From 7f7b6fd5f5edacf8726b58326ea35324f9df3307 Mon Sep 17 00:00:00 2001 From: jLynx Date: Fri, 1 Nov 2024 15:36:25 +1300 Subject: [PATCH] Removed logs --- Cargo.lock | 1 - plugins/updater/Cargo.toml | 1 - plugins/updater/src/updater.rs | 23 ++++++++--------------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69b6b9a3..2044a052 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7026,7 +7026,6 @@ dependencies = [ "futures-util", "http", "infer", - "log", "minisign-verify", "percent-encoding", "reqwest", diff --git a/plugins/updater/Cargo.toml b/plugins/updater/Cargo.toml index 29f7c867..9a1944e8 100644 --- a/plugins/updater/Cargo.toml +++ b/plugins/updater/Cargo.toml @@ -26,7 +26,6 @@ ios = { level = "none", notes = "" } tauri-plugin = { workspace = true, features = ["build"] } [dependencies] -log = "0.4" tauri = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/plugins/updater/src/updater.rs b/plugins/updater/src/updater.rs index d2fb047e..b7985168 100644 --- a/plugins/updater/src/updater.rs +++ b/plugins/updater/src/updater.rs @@ -757,11 +757,15 @@ impl Update { target_os = "openbsd" ))] impl Update { + /// ### Expected structure: + /// ├── [AppName]_[version]_amd64.AppImage.tar.gz # GZ generated by tauri-bundler + /// │ └──[AppName]_[version]_amd64.AppImage # Application AppImage + /// ├── [AppName]_[version]_amd64.deb.tar.gz # GZ generated by tauri-bundler + /// │ └──[AppName]_[version]_amd64.deb # Debian package + /// ├── [AppName]_[version]_amd64.deb # Debian package + /// └── ... + /// fn install_inner(&self, bytes: &[u8]) -> Result<()> { - log::warn!("=========== UPDATE =================="); - log::warn!("Starting Linux update installation"); - log::warn!("Extract path: {:?}", self.extract_path); - if self.is_deb_package() { self.install_deb_update(bytes) } else { @@ -849,11 +853,8 @@ impl Update { } fn install_deb_update(&self, bytes: &[u8]) -> Result<()> { - use std::process::Command; use flate2::read::GzDecoder; - log::warn!("Starting DEB package installation"); - // Create a temporary directory let tmp_dir = tempfile::Builder::new() .prefix("tauri_deb_update") @@ -863,7 +864,6 @@ impl Update { // Check if we need to extract from tar.gz first if infer::archive::is_gz(bytes) { - log::warn!("Detected tar.gz archive, extracting DEB package..."); let decoder = GzDecoder::new(Cursor::new(bytes)); let mut archive = tar::Archive::new(decoder); @@ -872,7 +872,6 @@ impl Update { for mut entry in archive.entries()?.flatten() { if let Ok(path) = entry.path() { if path.extension() == Some(OsStr::new("deb")) { - log::warn!("Found DEB package in archive, extracting to: {}", deb_path.display()); entry.unpack(&deb_path)?; found_deb = true; break; @@ -886,11 +885,8 @@ impl Update { } } else { // Direct .deb file - log::warn!("Writing DEB package directly to: {}", deb_path.display()); std::fs::write(&deb_path, bytes)?; } - - log::warn!("Preparing to install DEB package from: {}", deb_path.display()); // Try different privilege escalation methods let installation_result = self.try_install_with_privileges(&deb_path); @@ -910,7 +906,6 @@ impl Update { .status() { if status.success() { - log::warn!("Successfully installed update using pkexec"); return Ok(()); } } @@ -918,13 +913,11 @@ impl Update { // 2. Try zenity for a more user-friendly graphical sudo experience if let Ok(password) = self.get_password_graphically() { if self.install_with_sudo(deb_path, &password)? { - log::warn!("Successfully installed update using sudo (graphical)"); return Ok(()); } } // 3. Final fallback: terminal sudo - log::warn!("Falling back to terminal sudo for installation"); let status = std::process::Command::new("sudo") .arg("dpkg") .arg("-i")