Repository navigation
Conversation
5e7f848 to
98db0f8
Compare
|
I love that you're tackling this problem! |
Matching links by what they point at (follow-up idea)The fixes I'm proposing all patch the same underlying thing. One rule could cover all of these. Instead of predicting a single name, With that rule, GNU Stow 2.4.1 requires the flag on The cost is a larger change to I'd suggest landing the guard-based fixes here, since they are small and keep the design of this PR, and opening a follow-up issue for the target-based approach. I'm happy to prototype it if that would help. |
A package entry named 'dot-foo' is linked as '.foo', like GNU stow's
--dotfiles. A name whose prefix is followed by nothing or by a dot ('dot-',
'dot-.', 'dot-..', 'dot-.hidden') is left untranslated, so a link can never
resolve outside the destination.
Unstow matches links by what they point at instead of predicting their name
from the flag. For each package entry it checks both 'dot-foo' and '.foo'
(and the same inside unfolded directories) and removes whichever links into
the package, so it does not need the flag and a package stowed with either
setting, or both, is removed by one unstow. Only links into the package are
touched under the name the flag does not predict, so an unrelated file there
is never a conflict. Folding after an unstow unlinks the links it found
rather than looking them up again by name.
Adds a changelog entry and documents the flag in the README.
Co-authored-by: Fredrik Mellström <11281108+harkabeeparolus@users.noreply.github.com>
Co-authored-by: Ryan Carney <arecarn@gmail.com>
When both 'dot-foo' and '.foo' are real directories holding links, unstow removed a link under one name and then printed "already unlinked" for the same entry under the other. Entries whose link was queued under the name the flag does not predict are now skipped by the already-unlinked report.
'dot-a' in one package and '.a' in another map to the same destination name with --dotfiles, so stowing both must report a conflict.
Defines dotfile translation, literal name, translated name and matching by target, and says unstow recognises links by their target.
|
Merged. Thank you @menghuu for the original --dotfiles work in #16. Your commit is the base of this change, and you are the author of the merged commit. Thank you also @harkabeeparolus for the review and the fixes in #45, which are included. |
Adds
--dotfiles: a package entry nameddot-foois stowed as.foo, like GNU stow. Builds on #16 by @menghuu.stowaccepts the flag. Names that would resolve outside the destination (dot-,dot-.,dot-..,dot-.hidden) are left as they are, as GNU stow does.unstowfinds links by what they point at, so it removes them whether they are nameddot-fooor.foo. It does not need the flag, and still accepts it.Closes #30.