fix(link): detect broken same-package symlinks and add --overwrite flag#23
Open
jhult wants to merge 1 commit into
Open
fix(link): detect broken same-package symlinks and add --overwrite flag#23jhult wants to merge 1 commit into
jhult wants to merge 1 commit into
Conversation
Two related fixes to stout link: Detect broken symlinks as stale same-package links: when a dangling symlink's target path resides under the package's Cellar directory (e.g., 1.15.10 after 1.15.12 is installed), recognize it as a stale same-package link and replace it rather than skipping with a warning that it's "owned by a different package." Previously canonicalize() failed on the missing target, so is_same_package resolved to false. Add --overwrite flag to replace existing files: wire up the previously dead --overwrite flag so that when set, link_package removes and recreates symlinks even when the target is occupied by a symlink from another package, a regular file, or a directory. --force has been removed as it was redundant; its keg-only semantics are not yet applicable to stout.
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.
Two fixes to
stout link:1.15.10after1.15.12is installed), it's correctly recognized as a stale same-package link and replaced. Previouslycanonicalize()failed on the missing target, causing the code to skip it as "owned by a different package."--overwriteflag now works — The previously dead--overwriteflag actually removes blocking files/symlinks and creates new ones. The dead--forceflag was removed as redundant (to--overwrite).