fix(upgrade): sync state, deduplicate casks, and auto-repair on errors#22
Open
jhult wants to merge 3 commits into
Open
fix(upgrade): sync state, deduplicate casks, and auto-repair on errors#22jhult wants to merge 3 commits into
jhult wants to merge 3 commits into
Conversation
Upgrade now reconciles state with the Cellar at the start, before any package upgrades occur. This removes orphaned entries for packages no longer on disk, preventing state drift from accumulating across multiple upgrade cycles. State is synced explicitly and the cleanup is reported to the user, ensuring the upgrade begins with authoritative state rather than potentially stale data.
d625954 to
40f071f
Compare
Extract Mach-O file discovery, placeholder scanning, and code signature checking/fixing into shared functions so both doctor and upgrade use the same code paths. The new fix_upgrade_issues() entry point accepts a should_fix flag and optional package list, letting callers scan only or apply fixes. The doctor run() function now delegates to fix_upgrade_issues() instead of inlining WalkDir loops for placeholders and signatures. This eliminates redundant scanning (signatures were previously checked twice) and removes the rayon dependency. On the upgrade side, errors are printed inline as they occur instead of being collected into a vector for summary display. After all packages are processed, fix_upgrade_issues() runs automatically on affected packages to repair placeholders and code signatures. Error tracking switches from a Vec<(String, String)> to a boolean and an affected package list. Also adds Database::open_readonly() for opening source databases without applying the local schema and uses it in the cask index sync path.
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.
Three changes to make upgrade more reliable:
fix_upgrade_issues()function in doctor that also eliminates redundant scanning when runningdoctor --fixdirectly.