Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for unarchiving .zip archives #88

Closed
kylewlacy opened this issue Jul 15, 2024 · 1 comment · Fixed by #176
Closed

Add support for unarchiving .zip archives #88

kylewlacy opened this issue Jul 15, 2024 · 1 comment · Fixed by #176
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kylewlacy
Copy link
Member

The unarchive recipe (e.g. std.download({ ... }).unarchive("tar", "gzip")) supports multiple compression formats, but currently only supports tar archives. Zip archives are also pretty common, so we should update the recipe to also support zip as an archive type

const source = std
  .download({
    url: "https://github.com/brioche-dev/brioche/archive/refs/tags/v0.1.1.zip",
    hash: std.sha256sum("1e98a694fe530de5d641ecfa03c0f2f61ba7eba020866a1876ab2c4eaffb1525"),
  })
  .unarchive("zip");

Zip files can themselves be compressed, so there isn't an extra layer of decompression to worry about like you often see with .tar files. In other words, unarchiving a zip file will usually not specify a compression format. However, for consistency, it might still make sense to allow specifying a decompression format, even though I wouldn't expect it to be used in practice

@paricbat
Copy link
Contributor

paricbat commented Feb 5, 2025

I'll try working on this :3

paricbat added a commit to paricbat/brioche that referenced this issue Feb 5, 2025
I selected the features of the `zip` crate from the defaults, minus
support for encryption and time.

Fixes brioche-dev#88
kylewlacy added a commit that referenced this issue Feb 8, 2025
* Add support for unarchiving `.zip` archives

I selected the features of the `zip` crate from the defaults, minus
support for encryption and time.

Fixes #88

* Inform users that zip archives with an extra layer of compression are not supported

* Run `cargo fmt`

---------

Co-authored-by: Kyle Lacy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants