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

[RFE] Attempted to restore attributes from specification #16

Closed
vbatts opened this issue Jul 14, 2016 · 1 comment · Fixed by #138
Closed

[RFE] Attempted to restore attributes from specification #16

vbatts opened this issue Jul 14, 2016 · 1 comment · Fixed by #138

Comments

@vbatts
Copy link
Owner

vbatts commented Jul 14, 2016

like the -t and -u flags of the mtree cli.

     -t                 Modify the modified time of existing files, the device
                        type of devices, and symbolic link targets, to match
                        the specification.
     -u                 Modify the owner, group, permissions, and flags of
                        existing files, the device type of devices, and sym-
                        bolic link targets, to match the specification.  Cre-
                        ate any missing directories, devices or symbolic
                        links.  User, group, and permissions must all be spec-
                        ified for missing directories to be created.  Note
                        that unless the -i option is given, the schg and
                        sappnd flags will not be set, even if specified.  If
                        -m is given, these flags will be reset.  Exit with a
                        status of 0 on success, 2 if the file hierarchy did
                        not match the specification, and 1 if any other error
                        occurred.
@vbatts
Copy link
Owner Author

vbatts commented Jul 26, 2016

As part of this, I'm going to change the behavior of the xattr keyword.
Rather than having the value being a sha1 digest of the value, I'm instead going to right the actual value but base64 encoded.
I was two ways about this, but after chatting with @mjg59 I'm going to go with base64, so the values could be restored to a file.

vbatts added a commit that referenced this issue Jun 26, 2017
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.

Now it's closer, but is seeming to set the wrong mode and time
vbatts added a commit that referenced this issue Jun 28, 2017
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. This is a TODO.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
vbatts added a commit that referenced this issue Jun 28, 2017
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. This is a TODO.

Also a huge TODO would be, each updateFunc would _only_ perform the
update if it is needed. Much less invasive this way.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
vbatts added a commit that referenced this issue 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>
vbatts added a commit that referenced this issue 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>
vbatts added a commit that referenced this issue 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>
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 a pull request may close this issue.

1 participant