-
Notifications
You must be signed in to change notification settings - Fork 313
Add ability to not store extra attributes #398
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
Comments
Does this (not yet merged) example help? #365 |
That's pretty similar to the snippet I had above, but my main worry with such an approach is that it depends on internal APIs that may end up changing at some point in the future. Ideally this could be done as an option something like I can make a PR to make the |
Zip::File.open(name, Zip::File::CREATE, false, reproducible: true), with a test case. |
Zip::File.open("a.zip", Zip::File::CREATE) do |zipfile| |
In terms of locking down the timestamp of a file, we're going through making sure this works correctly in #413, which may actually do what you need here once it's complete. |
I do think that the ability to not store extra attributes by default is a good feature to consider. I'm going to look into sensible strategies for implementing this. I'd be interested in people's thoughts on whether this aught to be a setting applied at the archive, or individual file level, or some combination of both. |
While working on #421 I have convinced myself that there should be some sort of control over which extra fields are stored. I am looking into this now. |
Thanks for the PRs, which are both now landed. I am wondering whether we are at a good place for a new release, probably 2.1.0, or whether to hold a bit longer and try to get this in, given that you've been working on it @hainesr ?
For better or (more likely) for worse, I am not sure there is a very clear distinction between internal and external APIs in this library, at present. So, if we did change the signature of
I think there are several possible implementations of this idea:
and I am not sure that one is universally preferred (do you care about mtimes when you're doing the hash, or just the content?), so TBH I'm leaning toward just documenting how to do it, as in #365, rather than trying to implement one of the above. I could be swayed, however. |
Note: I've now gone ahead and released 2.1.0. |
I'm working on a wholesale replacement of the extra fields code which will include the option to save none and/or strip out, etc. No guarantees about timescales - it's a gnarly area of the codebase - but I am working on it. And it will require a major version bump. |
I have a scenario where I would like to create a zip that resolves to the same hash each time, similar to how the *nix
zip -X
flag works, but ideally more cross-platform. To that effect it would be nice to have an option to disable the storage of additional fields.Currently I can hack it in by doing something like this, but it would be nice to just have a flag I could set.
The text was updated successfully, but these errors were encountered: