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

Document how to create a reproducible ZIP file #364

Open
guss77 opened this issue May 17, 2018 · 3 comments
Open

Document how to create a reproducible ZIP file #364

guss77 opened this issue May 17, 2018 · 3 comments

Comments

@guss77
Copy link

guss77 commented May 17, 2018

I think it will be useful to document how to create a reproducible ZIP file - i.e. a ZIP file that has identical content as long as the source files have not changed.

This is very useful for build services and all kinds of cache management services, and its pretty easy to do - you just have to zero out the time field.

See here for a discussion

guss77 added a commit to guss77/rubyzip that referenced this issue May 17, 2018
@GrimmDaddy
Copy link

zip -X -r foo1.zip foo; sleep 5; touch foo/*; zip -X -r foo2.zip foo; cmp foo1.zip foo2.zip

@DanRathbun
Copy link

If PR #365 was rejected and closed, should this issue also be closed for v3.x ?
(It might have been added to the v2.x docs, but would then likely need to have been removed for 3.0.)

@guss77
Copy link
Author

guss77 commented Mar 6, 2022

While at that time, the close comment at #365 made sense to me, I think there is still a use case for forcing the file time to zero - to handle cases where the last modified timestamp changes without the file content changing: some processes can cause multiple source copies to have differing time stamps for the same content.

Its not high priority for me as I'm already doing what I need to be doing, but I thought that other people may be interested in documenting the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants