Removed logs

pull/1991/head
jLynx 9 months ago
parent a3f8462ec1
commit 7f7b6fd5f5

1
Cargo.lock generated

@ -7026,7 +7026,6 @@ dependencies = [
"futures-util",
"http",
"infer",
"log",
"minisign-verify",
"percent-encoding",
"reqwest",

@ -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 }

@ -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,12 +885,9 @@ 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")

Loading…
Cancel
Save