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

getmodules: support tbz2 module archives #36081

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bschaatsbergen
Copy link
Member

@bschaatsbergen bschaatsbergen commented Nov 22, 2024

Closes #36080

Our documentation suggests that module archives with tar.bz2, tar.tbz2 and tbz2 can be fetched—however tbz2 was not supported.

In go-getter there is a decompressor for tar archives compressed with bzip2 that can handle both tar.bz2, tar.tbz2 and tbz2 files. See https://github.com/hashicorp/go-getter/blob/main/decompress_tbz2.go#L28-L48

This PR adds support for decompressing tbz2 files, enabling the unpacking of tbz2 module archives, and improves the ordering of defined go-getter getter sets.

The `tbz2` extension, a shorthand for `tar.bz2`, is supported for downloading and handling compressed archives in go-getter, which already treats both `tbz2` and `tar.bz2` as using the same bzip2 decompressor. This commit adds support for the `tbz2` decompressor when fetching modules from a source.

Signed-off-by: Bruno Schaatsbergen <[email protected]>
- Grouped decompressor extensions (bz2, gzip, xz, zip).
- Grouped getters (protocol-based, cloud storage, version control, file-based).

Signed-off-by: Bruno Schaatsbergen <[email protected]>
@bschaatsbergen bschaatsbergen marked this pull request as ready for review November 22, 2024 19:11
@bschaatsbergen bschaatsbergen requested a review from a team as a code owner November 22, 2024 19:11

// Bzip2
"bz2": new(getter.Bzip2Decompressor),
"tbz2": new(getter.TarBzip2Decompressor),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity, this tbz2 decompressor has been added.

Signed-off-by: Bruno Schaatsbergen <[email protected]>
@bschaatsbergen bschaatsbergen requested a review from a team as a code owner November 22, 2024 19:41
@crw crw added the bug label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unreadable module directory when module is .tbz2 archive
2 participants