This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 390
Rewrite entire package #99
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Nov 6, 2018
Closed
komuw
reviewed
Nov 6, 2018
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. |
mholt
changed the title
Rewrite entire package (WIP - not ready for merge)
Rewrite entire package (needs review)
Nov 6, 2018
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.
This was referenced Nov 7, 2018
# Conflicts: # archiver_test.go # bz2.go # cmd/archiver/main.go # gz.go
This was referenced Nov 7, 2018
ghost
mentioned this pull request
Nov 9, 2018
sameersbn
pushed a commit
to sameersbn/kube-prod-runtime
that referenced
this pull request
Nov 12, 2018
anguslees
pushed a commit
to vmware-archive/kube-prod-runtime
that referenced
this pull request
Nov 12, 2018
sameersbn
pushed a commit
to sameersbn/kube-prod-runtime
that referenced
this pull request
Nov 13, 2018
see mholt/archiver#99 (cherry picked from commit e34ed02) Signed-off-by: Sameer Naik <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).