Skip to content

Recover updates from retired package conflicts - #6826

Closed
yashranaway wants to merge 1 commit into
omacom:quattrofrom
yashranaway:fix/retired-package-update-conflicts
Closed

Recover updates from retired package conflicts#6826
yashranaway wants to merge 1 commit into
omacom:quattrofrom
yashranaway:fix/retired-package-update-conflicts

Conversation

@yashranaway

Copy link
Copy Markdown
Contributor

Keep upstream package splits from wedging unattended updates.

<<< AI wording below >>>

Problem

pacman -Syu --noconfirm answers No to package-conflict removal prompts. With the current QEMU transition, qemu-common conflicts with the retired qemu-block-gluster, so an otherwise valid update stops every time.

Fix

  • Retry with Pacman's narrowly scoped conflict answer only when every removal target was installed as a dependency and is absent from the configured sync repositories
  • Leave explicitly installed, still-published, and mixed safe/unsafe conflicts for a human
  • Keep the existing one-retry boundary so a second failure cannot loop

Fixes #6818.

Verification

  • bash test/shell.d/update-file-conflict-test.sh
  • bash -n bin/omarchy-update-system-pkgs bin/omarchy-update-system-pkgs-when-conflicted test/shell.d/update-file-conflict-test.sh
  • git diff --check

Copilot AI balanced review requested due to automatic review settings August 13, 2026 19:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds safe recovery for unattended Pacman updates blocked by retired dependency conflicts.

Changes:

  • Detects dependency-installed packages absent from sync repositories.
  • Retries once with Pacman’s conflict-removal answer enabled.
  • Tests safe, unsafe, mixed, and direct-invocation scenarios.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.

File Description
bin/omarchy-update-system-pkgs Conditionally enables conflict removal on validated retries.
bin/omarchy-update-system-pkgs-when-conflicted Validates retired dependencies and initiates one retry.
test/shell.d/update-file-conflict-test.sh Covers package-conflict recovery and safety boundaries.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dhh

dhh commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Closing in favour of #6830, which takes the other route out of #6818: hand the conflict question back to the person running the update rather than prove an answer safe.

Two things this branch runs into that are worth recording, both reproduced against pacman 7.1 with real packages in a fakeroot:

  1. Under --noconfirm, pacman prints its questions to stdout, not stderr. omarchy-update-system-pkgs captures only 2>"$errors", so the :: … Remove …? [y/N] line never reaches the report the handler parses — conflict_removal_count is 0 and the new block never fires. Only the two error: lines are on stderr.

  2. The real prompt ends [y/N] with a trailing space, so the $-anchored lookahead (?=\? \[y/N\]$) cannot match it even when the line is present.

The tests pass because write_raw_report hand-writes the fixture, so neither the stream nor the trailing space is modelled.

The vetting itself was sound, for what it's worth — -Qd plus -Qm, all-or-nothing, and the three-variable guard — and --ask 4 does what it claims: it inverts the default for only the masked question type, leaving Replace X with Y? [Y/n] answered Yes as before. Thank you for digging into this one.

— 🤖 Claude, posting on behalf of @dhh

@dhh dhh closed this Aug 13, 2026
@yashranaway
yashranaway deleted the fix/retired-package-update-conflicts branch August 14, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upstream qemu update blocks omarchy update

3 participants