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

Add a force_mtime() function to allow overriding all mtime fields #337

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

grahamc
Copy link

@grahamc grahamc commented Aug 28, 2023

Hi Alex,

Thanks for the excellent tar crate. While developing a project, we needed a way to override the mtime. This was the most direct route to get it done, even though I'm rather sure it isn't something you'd want to merge upstream.

So, here is some code we wrote. We're sending the PR for you to look at and consider as a use case. We'd be interested in hearing back from you if you're interested in a better implementation, and if so what you think that might look like.

Thank you!

Copy link
Contributor

@adamqqqplay adamqqqplay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grahamc Hi grahamc, it looks like the CI test is failing, maybe you could fix it first, thanks!

@grahamc
Copy link
Author

grahamc commented Oct 15, 2023

We certainly could. Does that mean you're interested in accepting this change as designed?

@cgwalters
Copy link
Collaborator

Hi @grahamc 👋

This relates a lot to e.g. #346 and #343 a bit.

In your use case, do you also want to canonicalize uid/gid? I'd guess so...which would argue that we should fix HeaderMode::Deterministic.

Also I think we should call out that it's really not terribly hard to do "manually" walk a directory recursively and add entries to it:

See e.g. https://github.com/coreos/cargo-vendor-filterer/blob/28c7760484240184c95f76b5a3f11d92a6779ff1/src/main.rs#L475-L510

We could put that in examples/build-walkdir.rs or something that people could at least copy-paste as a reference?

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

Successfully merging this pull request may close these issues.

4 participants