-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Rewrite entire package #99
Conversation
archive/tar.go
Outdated
} | ||
|
||
// Compile-time checks to ensure type implements desired interfaces. | ||
var ( |
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.
I learn something new everyday.
thanks for this. 👍
I decided to leave the package name the same, rather than introduce a different import path, etc. However the command name is now "arc" (I know it's not 100% unique or original -- but I didn't like typing out This will be Archiver 3.0. |
The archivers' walks now skip the output archive, if contained in one of the source directory trees. For zip files, it would fill the disk and for tar files it would be included in the archive, about 10 KB of it... Tar now closes the Reader/Writer wrapper last, after the inner tar writer/reader has been closed. Otherwise result is a corrupted archive that could be opened by archiver, but not by the OS.
# Conflicts: # archiver_test.go # bz2.go # cmd/archiver/main.go # gz.go
see mholt/archiver#99 (cherry picked from commit e34ed02) Signed-off-by: Sameer Naik <sameer@bitnami.com>
Alright, this little library has become quite an important tool for me over the last couple years and it's time to give it some TLC.
For background, see #90 (and frankly all other open and even closed issues).
This change supersedes all open PRs. Any open PRs will need to be reconsidered and, if still relevant, rebased.
Closes #90. <-- main issue
Closes #22.
Closes #39.
Closes #58.
Closes #61.
Closes #68.
Closes #80.
Closes #97.
Format progress
Other features progress
Highlights
DefaultZip
, etc, with some sane defaults that are ready to use):When creating archives, file extension MUST match the archive type.
They can open and extract whole archives like this:
io.ReadCloser
s! - they get closed for you when the walk function returns):It should work similarly for the other archive formats.
Single-file compression and decompression is possible, too.
This PR includes a fully functional CLI. One feature request I would still add is the ability to stream compressors and decompressors through the stdin and stdout, but that can come later. Very easy to add.
We can potentially implement options to configure symlink handling and even scan for zip-slip patterns and prevent an ugly extraction (but we cannot fix zip-slip implicitly, unfortunately).