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

*: update -u behavior #138

Merged
merged 2 commits into from
Jun 30, 2017
Merged

*: update -u behavior #138

merged 2 commits into from
Jun 30, 2017

Conversation

vbatts
Copy link
Owner

@vbatts vbatts commented Jun 30, 2017

Fixes #16

In attempt to close #16 I've
uncovered that the update was missing a function for symlink.
Additionally the update was not even opperating on the correct directory
hierarchy.

I've uncovered that os.Chtimes follows the symlink, and presumably only
Linux has an obscure way to set the mtime/atime on a symlink itself. So
I've made a custom lchtimes().

Also Mode follows through the symlink, and symlinks only ever have a
mode of 0777, so don't set them.

Lastly, directories need to have their mtime/atime set in a reverse
order after all other updates have been done. This is going to require
something like a container/heap to be unwound.

Also, each updateFunc will only perform the update if it is needed. Much less
invasive this way.

Signed-off-by: Vincent Batts vbatts@hashbangbash.com

Fixes #16

In attempt to close #16 I've
uncovered that the update was missing a function for symlink.
Additionally the update was not even opperating on the correct directory
hierarchy.

I've uncovered that os.Chtimes follows the symlink, and presumably only
Linux has an obscure way to set the mtime/atime on a symlink itself. So
I've made a custom lchtimes().

Also Mode follows through the symlink, and symlinks only ever have a
mode of 0777, so don't set them.

Lastly, directories need to have their mtime/atime set in a reverse
order after all other updates have been done. This is going to require
something like a `container/heap` to be unwound.

Also, each updateFunc will _only_ perform the update if it is needed. Much less
invasive this way.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
@vbatts
Copy link
Owner Author

vbatts commented Jun 30, 2017

tests pass

@vbatts vbatts merged commit 2ede6ec into master Jun 30, 2017
@vbatts vbatts deleted the match_update_behavior branch June 30, 2017 19:42
@vbatts
Copy link
Owner Author

vbatts commented Jun 30, 2017

ping @mjg59 here is the rest of updating a filesystem from a manifest. Including xattrs

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.

[RFE] Attempted to restore attributes from specification
1 participant