-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat: add support for hard links #179
Conversation
Hard links can now be extracted and they are correctly reflected in the manifest. --------- Co-authored-by: Rafid Bin Mostofa <[email protected]> Co-authored-by: Alberto Carretero <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Alberto. This is looking great.
A few comments, and maybe the last pass:
internal/deb/extract.go
Outdated
|
||
// sanitizeTarPath removes the leading "./" from the source path in the tarball, | ||
// and verifies that the path is not empty. | ||
func sanitizeTarPath(path string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any logic that prevents the tar from leaving the target directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we don't at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed offline to do it, just not in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! A few more trivials, mainly just follow ups of the previous points.
LGTM.
internal/deb/extract.go
Outdated
} | ||
} | ||
sort.Strings(errs) | ||
return fmt.Errorf("%s", errs[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per comment in the prior review, we don't need to append all the errors to then return the first one. We can simply stop on the first thing we find and return the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with that is that the error won't be deterministic, right? Maybe we can sort the links instead of the error if that is more performant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Hard links can now be extracted and they are correctly reflected in the manifest.