diff --git a/.changes/libflate-to-flate2.md b/.changes/libflate-to-flate2.md new file mode 100644 index 000000000000..fa17c89260f0 --- /dev/null +++ b/.changes/libflate-to-flate2.md @@ -0,0 +1,5 @@ +--- +"tauri-bundler": patch:deps +--- + +Replace `libflate` with `flate2` , this will help to provide additional functionalities and features. diff --git a/tooling/bundler/Cargo.toml b/tooling/bundler/Cargo.toml index e43ee3ce6960..57b9518d1cb6 100644 --- a/tooling/bundler/Cargo.toml +++ b/tooling/bundler/Cargo.toml @@ -19,7 +19,7 @@ exclude = [ "CHANGELOG.md", "/target", "rustfmt.toml" ] [dependencies] tauri-utils = { version = "1.5.2", path = "../../core/tauri-utils", features = [ "resources" ] } image = "0.24.7" -libflate = "2.0" +flate2 = "1.0" anyhow = "1.0" thiserror = "1.0" serde_json = "1.0" diff --git a/tooling/bundler/src/bundle/linux/debian.rs b/tooling/bundler/src/bundle/linux/debian.rs index 20b06eaf13a9..28300d4dc7ca 100644 --- a/tooling/bundler/src/bundle/linux/debian.rs +++ b/tooling/bundler/src/bundle/linux/debian.rs @@ -29,7 +29,6 @@ use anyhow::Context; use handlebars::Handlebars; use heck::AsKebabCase; use image::{self, codecs::png::PngDecoder, ImageDecoder}; -use libflate::gzip; use log::info; use serde::Serialize; use tar::HeaderMode; @@ -44,6 +43,8 @@ use std::{ path::{Path, PathBuf}, }; +use flate2::{write::GzEncoder, Compression}; + #[derive(PartialEq, Eq, PartialOrd, Ord)] pub struct DebIcon { pub width: u32, @@ -391,9 +392,9 @@ fn tar_and_gzip_dir>(src_dir: P) -> crate::Result { let src_dir = src_dir.as_ref(); let dest_path = src_dir.with_extension("tar.gz"); let dest_file = common::create_file(&dest_path)?; - let gzip_encoder = gzip::Encoder::new(dest_file)?; + let gzip_encoder = GzEncoder::new(dest_file, Compression::default()); let gzip_encoder = create_tar_from_dir(src_dir, gzip_encoder)?; - let mut dest_file = gzip_encoder.finish().into_result()?; + let mut dest_file = gzip_encoder.finish()?; dest_file.flush()?; Ok(dest_path) } diff --git a/tooling/bundler/src/bundle/updater_bundle.rs b/tooling/bundler/src/bundle/updater_bundle.rs index 0cb8d3b02a42..de957d44051e 100644 --- a/tooling/bundler/src/bundle/updater_bundle.rs +++ b/tooling/bundler/src/bundle/updater_bundle.rs @@ -23,6 +23,8 @@ use std::{ path::{Path, PathBuf}, }; +use flate2::{write::GzEncoder, Compression}; + use anyhow::Context; use log::info; use zip::write::FileOptions; @@ -235,11 +237,11 @@ pub fn create_zip(src_file: &Path, dst_file: &Path) -> crate::Result { #[cfg(not(target_os = "windows"))] fn create_tar(src_dir: &Path, dest_path: &Path) -> crate::Result { let dest_file = common::create_file(dest_path)?; - let gzip_encoder = libflate::gzip::Encoder::new(dest_file)?; + let gzip_encoder = GzEncoder::new(dest_file, Compression::default()); let gzip_encoder = create_tar_from_src(src_dir, gzip_encoder)?; - let mut dest_file = gzip_encoder.finish().into_result()?; + let mut dest_file = gzip_encoder.finish()?; dest_file.flush()?; Ok(dest_path.to_owned()) }