From 5fbc9912a306c2611a418fe792474a888a080039 Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Thu, 2 May 2024 10:59:48 -0700 Subject: [PATCH 1/4] fix: Build was failing with bzip2 enabled --- src/read.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/read.rs b/src/read.rs index 0a39faef..6fceb374 100644 --- a/src/read.rs +++ b/src/read.rs @@ -29,7 +29,7 @@ use flate2::read::DeflateDecoder; use deflate64::Deflate64Decoder; #[cfg(feature = "bzip2")] -use bzip2::read::BzDecoder; +use bzip2_rs::decoder::DecoderReader; #[cfg(feature = "zstd")] use zstd::stream::read::Decoder as ZstdDecoder; @@ -145,7 +145,7 @@ pub(crate) enum ZipFileReader<'a> { #[cfg(feature = "deflate64")] Deflate64(Crc32Reader>>>), #[cfg(feature = "bzip2")] - Bzip2(Crc32Reader>>), + Bzip2(Crc32Reader>>), #[cfg(feature = "zstd")] Zstd(Crc32Reader>>>), #[cfg(feature = "lzma")] @@ -306,7 +306,7 @@ pub(crate) fn make_reader( } #[cfg(feature = "bzip2")] CompressionMethod::Bzip2 => { - let bzip2_reader = BzDecoder::new(reader); + let bzip2_reader = DecoderReader::new(reader); ZipFileReader::Bzip2(Crc32Reader::new(bzip2_reader, crc32, ae2_encrypted)) } #[cfg(feature = "zstd")] From 2309eb7b642af885025c01bc1b834b1ad72988dc Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Thu, 2 May 2024 11:22:56 -0700 Subject: [PATCH 2/4] Revert "fix: Build was failing with bzip2 enabled" This reverts commit 5fbc9912a306c2611a418fe792474a888a080039. --- src/read.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/read.rs b/src/read.rs index 6fceb374..0a39faef 100644 --- a/src/read.rs +++ b/src/read.rs @@ -29,7 +29,7 @@ use flate2::read::DeflateDecoder; use deflate64::Deflate64Decoder; #[cfg(feature = "bzip2")] -use bzip2_rs::decoder::DecoderReader; +use bzip2::read::BzDecoder; #[cfg(feature = "zstd")] use zstd::stream::read::Decoder as ZstdDecoder; @@ -145,7 +145,7 @@ pub(crate) enum ZipFileReader<'a> { #[cfg(feature = "deflate64")] Deflate64(Crc32Reader>>>), #[cfg(feature = "bzip2")] - Bzip2(Crc32Reader>>), + Bzip2(Crc32Reader>>), #[cfg(feature = "zstd")] Zstd(Crc32Reader>>>), #[cfg(feature = "lzma")] @@ -306,7 +306,7 @@ pub(crate) fn make_reader( } #[cfg(feature = "bzip2")] CompressionMethod::Bzip2 => { - let bzip2_reader = DecoderReader::new(reader); + let bzip2_reader = BzDecoder::new(reader); ZipFileReader::Bzip2(Crc32Reader::new(bzip2_reader, crc32, ae2_encrypted)) } #[cfg(feature = "zstd")] From b5bc43857a926e63d2c7c91fe65bb4b8ddd0cfb9 Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Thu, 2 May 2024 11:23:32 -0700 Subject: [PATCH 3/4] Revert "Make bzip2 a synonym of bzip2-rs" This reverts commit 01a8ff41b13c76fe1df28427a4dadf27ad65ce91. --- Cargo.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fbf4c7ae..d033b2e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,9 +52,7 @@ getrandom = { version = "0.2.14", features = ["js"] } walkdir = "2.5.0" time = { workspace = true, features = ["formatting", "macros"] } anyhow = "1" - [features] -bzip2 = ["bzip2-rs"] aes-crypto = ["aes", "constant_time_eq", "hmac", "pbkdf2", "sha1"] chrono = ["chrono/default"] _deflate-any = [] From 2c3a3f5aa01ba8e5c6ae9d3ed8c36f0137cc0781 Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Thu, 2 May 2024 11:26:14 -0700 Subject: [PATCH 4/4] revert: #58 (partial): `bzip2-rs` can't replace `bzip2` because it's decompress-only --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d033b2e9..de163c4c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ time = { version = "0.3.36", default-features = false } [dependencies] aes = { version = "0.8.4", optional = true } byteorder = "1.5.0" -bzip2-rs = { version = "0.1.2", optional = true } +bzip2 = { version = "0.4.4", optional = true } chrono = { version = "0.4.38", optional = true } constant_time_eq = { version = "0.3.0", optional = true } crc32fast = "1.4.0" @@ -68,7 +68,7 @@ lzma = ["lzma-rs/stream"] unreserved = [] default = [ "aes-crypto", - "bzip2-rs", + "bzip2", "deflate", "deflate64", "deflate-zlib-ng",