Skip tmux.conf migration when the file is not writable - #9286
Open
fresh3nough wants to merge 1 commit into
Open
Conversation
migrations/1784401744.sh used sed -i on ~/.config/tmux/tmux.conf under bash -e. Nix/home-manager keeps that path as a symlink into a read-only store; GNU sed -i replaces the symlink with a regular file, and a hard write failure aborts the whole migration (including hardware package installs) so omarchy-migrate retries forever. Rewrite via a temp file and write through the path like the later tmux migration; skip with a notice when the write is refused. Fixes omacom#9284 Signed-off-by: fresh3nough <anonwurcod@proton.me>
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.
Summary
Fixes #9284.
migrations/1784401744.shrewrote~/.config/tmux/tmux.confwithsed -iunderbash -euo pipefail(howomarchy-migrateruns every migration). Declarative setups (Nix/home-manager) keep that path as a symlink into a read-only store:sed -ireplaces the symlink with a regular file (breaks the declarative link), oromarchy-migratenever writes a completion marker and retries forever.Change
Match
migrations/1785189600.sh: rewrite via a temp file andcat >"$tmux_config"(write-through keeps a writable symlink's target). If the write is refused, print a skip notice and continue so hardware backfill still runs.Test plan
sed -ion a store symlink → link replaced (BUG_REPRODUCED_symlink_replaced)./test/shell.d/tmux-readonly-migration-test.shpasses