fix: Linux installer keeps the live tree on a failed same-version reinstall; quote the pgrep pattern - #1024
Merged
Conversation
Independent-review follow-ups on the Linux installer: - A same-version `--force` reinstall used to RemoveAll the LIVE version dir before promoting the new tree, so a failed flip left `current` dangling. The live tree is now set aside inside staging and restored by restoreLinuxSwap when promotion or activation fails; rollback failures are reported as warnings instead of swallowed. - The temp activation symlink lives inside staging (same filesystem, so the rename over `current` stays atomic), which removes the stale-tmp pre-clear and the per-branch cleanup. - linuxProbePattern quotes the path for pgrep's ERE, so a --path with regex metacharacters still matches the running app. - Uninstall drops its redundant filepath.Abs — effectiveInstallDir already returns an absolute root. - Records PR #1023 on the 260917-ot32 change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Follow-up to #1023 (merged before this commit landed on its branch). Findings from an independent code review of #1023:
Changes
--forcereinstall no longer destroys the live tree first. It is set aside inside the staging dir (same filesystem, atomic rename) and put back byrestoreLinuxSwapwhen promotion or the activation flip fails; rollback failures are reported as warnings instead of swallowed. Previously a failed flip leftcurrentdangling with nothing installed.current.tmpand the per-branch cleanup code is gone.linuxProbePatternquotes the path for pgrep's ERE, so a--pathcontaining regex metacharacters still matches the running app (the swap could otherwise proceed under a live app).Uninstalldrops a redundantfilepath.Abs(the root is already absolute).Tests
TestRestoreLinuxSwapPutsThePreviousTreeBackTestInstallLinuxSameVersionForceReplacesLiveTreeGates:
go test ./internal/desktop/... ./cmd/rk/...green,go vetclean, gofmt-clean.🤖 Generated with Claude Code