fix: Robust symlink handling in installer#295
Closed
edcet wants to merge 1 commit intobevry:masterfrom
Closed
Conversation
This fixes an issue where the installer would fail with 'Directory not empty' when attempting to create a symlink where the source and destination are identical paths. The problem commonly occurs when installing with DOROTHY pointing to an existing directory.
Member
|
Not sure just deleting Is this fixed already on the latest dev branch, which is |
Author
|
Apologies for the noise. |
28 tasks
Member
|
#281 is now merged which fixes this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses issues in the Dorothy installer (
commands/dorothy) related to symbolic link creation, specifically:ln -s /path/to/dir /path/to/dir). This often occurs with--no-xdginstallations.mvorlnoperations within relocation functions, preventing "No such file or directory" errors for__fs_realpathormv.Problem Details:
relocate_then_symlink_if_necessaryfunction could fail if$symlinkand$destinationwere the same, asln -sfFcannot replace a non-empty directory with a symlink to itself.$symlinkwas a broken symlink and identical to$destination, the broken link wasn't cleaned up.relocate_if_necessaryfunction could fail if parent directories for$destinationdidn't exist beforemvor__fs_realpathcalls.Fixes Implemented:
relocate_then_symlink_if_necessary:$symlinkand$destinationare identical, it now first removes$symlinkif it's a broken symlink, then skips thelnoperation.$symlinkand$destinationare created usingmkdir -pat the beginning of the function.relocate_if_necessary:$sourceand$destinationare created usingmkdir -pat the beginning of the function.Testing:
Verified on macOS:
DOROTHYis set to an existing target directory (testing identical path fix).grealpatherrors.