diff --git a/.gitignore b/.gitignore index ea8c4bf..a72c1f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ /target + +# Rust Rover +/.idea diff --git a/Cargo.lock b/Cargo.lock index 69b87d7..04d248c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1382,6 +1382,26 @@ version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +[[package]] +name = "liblzma" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7c45fc6fcf5b527d3cf89c1dee8c327943984b0dc8bfcf6e100473b00969e63" +dependencies = [ + "liblzma-sys", +] + +[[package]] +name = "liblzma-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "885d379719f1be90c51852451dc658009c1aab2eb867cae8d5eb7f83bfaaca96" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "libredox" version = "0.1.3" @@ -1431,17 +1451,6 @@ dependencies = [ "crc", ] -[[package]] -name = "lzma-sys" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "matchers" version = "0.1.0" @@ -1935,6 +1944,7 @@ dependencies = [ "hex", "http", "human_bytes", + "liblzma", "md-5", "num-format", "quick-xml", @@ -1957,7 +1967,6 @@ dependencies = [ "tracing", "tracing-indicatif", "url", - "xz2", "zip", ] @@ -3779,15 +3788,6 @@ dependencies = [ "rustix", ] -[[package]] -name = "xz2" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" -dependencies = [ - "lzma-sys", -] - [[package]] name = "zerocopy" version = "0.7.35" diff --git a/Cargo.toml b/Cargo.toml index e3d2799..c4cce68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,6 +38,7 @@ http = "1.1.0" human_bytes = { version = "0.4.3", default-features = false } indicatif = "0.17.8" indoc = "2.0.5" +liblzma = "0.3.4" md-5 = "0.10.6" num-format = "0.4.4" pgvector = "0.4.0" @@ -65,7 +66,6 @@ tracing = "0.1.40" tracing-indicatif = "0.3.6" tracing-subscriber = "0.3.18" url = "2.5.2" -xz2 = "0.1.7" zip = "2.2.0" [workspace.metadata.release] diff --git a/postgresql_archive/Cargo.toml b/postgresql_archive/Cargo.toml index 860db6c..1d6247c 100644 --- a/postgresql_archive/Cargo.toml +++ b/postgresql_archive/Cargo.toml @@ -17,6 +17,7 @@ futures-util = { workspace = true } hex = { workspace = true } http = { workspace = true } human_bytes = { workspace = true, default-features = false } +liblzma = { workspace = true } md-5 = { workspace = true, optional = true } num-format = { workspace = true } quick-xml = { workspace = true, features = ["serialize"], optional = true } @@ -38,7 +39,6 @@ tokio = { workspace = true, features = ["full"], optional = true } tracing = { workspace = true, features = ["log"] } tracing-indicatif = { workspace = true } url = { workspace = true } -xz2 = { workspace = true } zip = { workspace = true } [dev-dependencies] diff --git a/postgresql_archive/src/extractor/tar_xz_extractor.rs b/postgresql_archive/src/extractor/tar_xz_extractor.rs index cecdd90..df2aae5 100644 --- a/postgresql_archive/src/extractor/tar_xz_extractor.rs +++ b/postgresql_archive/src/extractor/tar_xz_extractor.rs @@ -2,13 +2,13 @@ use crate::extractor::ExtractDirectories; use crate::Error::Unexpected; use crate::Result; use human_bytes::human_bytes; +use liblzma::bufread::XzDecoder; use num_format::{Locale, ToFormattedString}; use std::fs::{create_dir_all, File}; use std::io::{copy, BufReader, Cursor}; use std::path::PathBuf; use tar::Archive; use tracing::{debug, instrument, warn}; -use xz2::bufread::XzDecoder; /// Extracts the compressed tar `bytes` to paths defined in `extract_directories`. ///