-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 to TarArchiver for more common compression suffixes #8369
base: main
Are you sure you want to change the base?
Conversation
- include more suffixes for: gzip, bzip2, lzma, xz
I wasn't sure about adding test files for all these extensions? |
@@ -16,7 +16,14 @@ import struct TSCBasic.FileSystemError | |||
|
|||
/// An `Archiver` that handles Tar archives using the command-line `tar` tool. | |||
public struct TarArchiver: Archiver { | |||
public let supportedExtensions: Set<String> = ["tar", "tar.gz"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't clear to me whether "tar.gz" is really needed or if "gz" is good enough here? The tar
commands don't seem to care:
tar tzf test.gz | head
6.0.3-RELEASE_rhel_ubi9_x86_64.artifactbundle/
6.0.3-RELEASE_rhel_ubi9_x86_64.artifactbundle/6.0.3-RELEASE_rhel_ubi9_x86_64/
6.0.3-RELEASE_rhel_ubi9_x86_64.artifactbundle/info.json
6.0.3-RELEASE_rhel_ubi9_x86_64.artifactbundle/6.0.3-RELEASE_rhel_ubi9_x86_64/x86_64-unknown-linux-gnu/
Tests would be extremely helpful. It's hard to know whether these things work or will stay working without them. |
Another thing to keep in mind that not all of these formats are supported by |
Is there a canonical list of supported platforms and their versions? |
Yes, it's available at https://swift.org/install |
Motivation:
Add support for compression algorithms that can achieve higher compression ratios than gzip.
Support another common extension for gzip as well.
Modifications:
I modified the list of supported extensions for the TarArchiver.
I researched various manpages to see what was commonly supported.
a
flag used for auto-compress whichTarArchiver.compress
uses ref. It also doesn't seem to have anything beyond gzip and bzip2 (no lzma or xz).Result:
More compression algorithms will be supported.