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
4 changes: 4 additions & 0 deletions src/backend/aqua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,10 @@ impl AquaBackend {
file::create_dir_all(&install_path)?;
file::un_xz(&tarball_path, &bin_path)?;
file::make_executable(&bin_path)?;
} else if format == "zst" {
file::create_dir_all(&install_path)?;
file::un_zst(&tarball_path, &bin_path)?;
file::make_executable(&bin_path)?;
} else if format == "bz2" {
file::create_dir_all(&install_path)?;
file::un_bz2(&tarball_path, &bin_path)?;
Expand Down
10 changes: 10 additions & 0 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,16 @@ pub fn un_xz(input: &Path, dest: &Path) -> Result<()> {
Ok(())
}

pub fn un_zst(input: &Path, dest: &Path) -> Result<()> {
debug!("zstd -d {} -c > {}", input.display(), dest.display());
let f = File::open(input)?;
let mut dec = zstd::Decoder::new(f)?;
let mut output = File::create(dest)?;
std::io::copy(&mut dec, &mut output)
.wrap_err_with(|| format!("failed to un-zst: {}", display_path(input)))?;
Ok(())
}

pub fn un_bz2(input: &Path, dest: &Path) -> Result<()> {
debug!("bzip2 -d {} -c > {}", input.display(), dest.display());
let f = File::open(input)?;
Expand Down
Loading