-
Notifications
You must be signed in to change notification settings - Fork 33
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
#910 Can not update intellij on linux #1101
#910 Can not update intellij on linux #1101
Conversation
…tion - Added LinkOption.NOFOLLOW_LINKS to verify if the symlink file itself exists or not - and not the target file/folder
…tion - Added LinkOption.NOFOLLOW_LINKS to verify if the symlink file itself exists or not - and not the target file/folder
Pull Request Test Coverage Report for Build 13669668814Details
💛 - Coveralls |
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.
LGTM. Ready for review. I've added a question, please check.
…tion - Removed exists() function from fileAccess because its just calling "super" - Adjusted usages of fileAccess.exists()
…on-linux' into fix/910-can-not-update-intellij-on-linux
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.
LGTM. Ready for review.
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.
@mbilda thanks for your analysis of this bug and providing this PR as a proper fix. Great work! 👍
…tion - Added entry to CHANGELOG.adoc
Fixes: #910
This PR fixes the issue if an simlink is broken and we check the file existence or want to delete the file.
If we wanna know if a file exists we wanna check the actual file itself and not the target where the simlink points to. That means if we wanna delete the actual file we shouldn't follow the simlink. Window automatically prevents that and always checks the file itself. Linux is a little bit "smarter" and knows that its a simlink file and automatically follows the link to the target file and checks if the target file exists. This is actually problematic, because we delete the simlink file and create a new one we a new target to update the versions.
LinkOption.NOFOLLOW_LINKS prevents both systems to follow the link in the simlink file and actually checks if the file itself exists.
This PR also reverts some changes from: #1078
As @hohwille suggested in an old PR:
#1078 (comment)
That the FileAcessImpl exists function doesn't really bring value to this i have decided to delete the method again.
That means we do not have to take care about some different behaviour because of the wrapper class where we may have a different implementation than using the usual Files.exists() function. The NOFOLLOW_LINKS option is set to the necessary places where we want to check the actual file and not the target of the simlink.