Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 31 additions & 45 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rusqlite = "0.38.0"
regex = "1.11.1"
reqwest = { version = "0.13", features = ["stream", "blocking"] }
async-compression = { version = "0.4", features = ["tokio", "gzip", "xz"] }
tokio-tar = "0.3.1"
astral-tokio-tar = "0.5.6"
tokio-util = { version = "0.7.13", features = ["compat"] }
futures = "0.3.31"
lazy_static = "1.5.0"
Expand Down
6 changes: 4 additions & 2 deletions crates/lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
};
use tempfile::tempdir_in;
use tokio::task;
use tokio_tar::Archive;
use tokio_tar::ArchiveBuilder;

// Compatibility trait lets us call `compat()` on a futures::io::AsyncRead
// to convert it into a tokio::io::AsyncRead.
Expand Down Expand Up @@ -108,7 +108,9 @@ where
let temp_dir = tempdir_in(config.pkgx_dir.join(&pkg.project))?;

// Step 4: Extract the tar archive
let mut archive = Archive::new(decoder);
let mut archive = ArchiveBuilder::new(decoder)
.set_preserve_permissions(true)
.build();
archive.unpack(&temp_dir).await?;

// Step 5: atomically move from temp dir to installation location
Expand Down
6 changes: 4 additions & 2 deletions crates/lib/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use fs2::FileExt;
use futures::TryStreamExt;
use rusqlite::Connection;
use std::{error::Error, fs::OpenOptions, path::PathBuf};
use tokio_tar::Archive;
use tokio_tar::ArchiveBuilder;
use tokio_util::compat::FuturesAsyncReadCompatExt;

#[allow(clippy::all)]
Expand Down Expand Up @@ -64,7 +64,9 @@ async fn download_and_extract_pantry(url: &str, dest: &PathBuf) -> Result<(), Bo
let decoder = XzDecoder::new(stream);

// Step 3: Extract the tar archive
let mut archive = Archive::new(decoder);
let mut archive = ArchiveBuilder::new(decoder)
.set_preserve_permissions(true)
.build();
archive.unpack(dest).await?;

Ok(())
Expand Down