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

Support PreserveTimes for symlinks on Unix #83

Merged
merged 11 commits into from
Aug 13, 2022
Merged

Support PreserveTimes for symlinks on Unix #83

merged 11 commits into from
Aug 13, 2022

Conversation

fako1024
Copy link
Contributor

This is an addition to #31 - While symlink timestamps cannot be set universally (neither at time of link creation nor by a simple call to os.Chtimes()) they can be set on Unix making use of unix.Lutimes(). This PR extends the existing PreserveTime option by that, transferring the original link timestamp(s) to the newly created one if the option is set.

For unsupported architectures, a stub is provided similar to already existing ones (e.g. for ownership preservation).

@codecov-commenter
Copy link

codecov-commenter commented Jul 23, 2022

Codecov Report

Merging #83 (55416e9) into main (be95711) will increase coverage by 1.43%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
+ Coverage   77.40%   78.83%   +1.43%     
==========================================
  Files          13       15       +2     
  Lines         177      189      +12     
==========================================
+ Hits          137      149      +12     
  Misses         20       20              
  Partials       20       20              
Impacted Files Coverage Δ
copy.go 76.47% <100.00%> (+0.96%) ⬆️
preserve_ltimes.go 100.00% <100.00%> (ø)
preserve_ltimes_x.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@otiai10 otiai10 self-requested a review July 26, 2022 06:34
Copy link
Owner

@otiai10 otiai10 left a comment

Choose a reason for hiding this comment

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

Getting Lstat in onsymlink could be inefficient operation for platforms who don't even need it.

@fako1024
Copy link
Contributor Author

@otiai10 It seems that a recent upstream change breaks the GopherJS Pipeline (unrelated to this issue):
gopherjs/gopherjs@f754ef8

What's your preference, should I open an independent issue for that? Do you want to fix it on main directly for a rebase?

@otiai10
Copy link
Owner

otiai10 commented Aug 10, 2022

Thank you, @fako1024

open an independent issue for that

This would be super cool! Thank you so much ;)

@otiai10 otiai10 merged commit 73c56ae into otiai10:main Aug 13, 2022
@otiai10
Copy link
Owner

otiai10 commented Aug 13, 2022

Thank you for everything!

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.

3 participants