Skip to content

Suppress keyring "reinstalling" warning in any locale - #7609

Open
fldc wants to merge 6 commits into
omacom:quattrofrom
fldc:fix/keyring-reinstall-warning-locale
Open

fldc wants to merge 6 commits into
omacom:quattrofrom
fldc:fix/keyring-reinstall-warning-locale

Conversation

@fldc

@fldc fldc commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This fixes a minor update annoyance of mine. :D

omarchy-update-keyring re-installs archlinux-keyring on every update and pipes the output through a grep -vE filter that hides pacman's "up to date -- reinstalling" warning.

That filter only matches the English string, but pacman prints the message in the user's locale. On a Swedish system (LANG=sv_SE.UTF-8) the warning leaked through on every update, producing noise even on a clean, successful run.

Fix

Force LC_ALL=C on the archlinux-keyring install so pacman's messages are always English and the existing filter reliably suppresses the warning, regardless of the user's locale.

-sudo pacman -Sy --noconfirm archlinux-keyring >/dev/null 2> >(grep -vE '^warning: archlinux-keyring-[^ ]+ is up to date -- reinstalling$' >&2)
+sudo env LC_ALL=C pacman -Sy --noconfirm archlinux-keyring >/dev/null 2> >(grep -vE '^warning: archlinux-keyring-[^ ]+ is up to date -- reinstalling$' >&2)

Changes:
bin/omarchy-update-keyring — one-line change plus a comment explaining why LC_ALL=C is set.

Verification:
Ran omarchy-update-keyring on a system with LANG=sv_SE.UTF-8; the "reinstalling" warning is no longer emitted.
Confirmed output remains clean on an English-locale system as well.

Fixes #18477

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

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.

Copilot wasn't able to review any files in this pull request.


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

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed. Nothing wrong with it — this does exactly what the description says, and it ships as-is as far as I can tell.

Verified end to end on a disposable Arch VM (pacman 7.1.0, libalpm 16.0.1) with sv_SE.UTF-8 generated, running the real line both ways:

  • Before: varning: archlinux-keyring-20260727-1 är senaste versionen -- återinstallerar leaks straight through the filter.
  • After: pacman emits warning: archlinux-keyring-20260727-1 is up to date -- reinstalling and the existing grep suppresses it. Clean stderr.

Three things the fix rests on, which I checked rather than assumed:

  • The msgid in libalpm.so.16 is %s-%s is up to date -- reinstalling with two ASCII hyphens, so the pattern still matches current pacman character for character. Worth noting the warning: prefix is itself translated (varning: in Swedish) — that is the other half of why the old filter missed, and LC_ALL=C fixes both.
  • LANGUAGE does not defeat it. gettext ignores LANGUAGE when the message locale is C, and LC_ALL=C LANGUAGE=sv still printed English here.
  • No ANSI escapes reach the filter even though Color is set in pacman.conf: stdout is /dev/null and stderr is a pipe, so pacman turns colour off and the ^/$ anchors hold.

sudo env is the right construction, and it matches bin/omarchy-update-system-pkgs:26, which already runs sudo env LC_ALL=C ... pacman -Syu.

One consequence worth stating plainly, more for the maintainer than for you: LC_ALL=C makes all of pacman's output English, so a Swedish user who hits a genuine failure in this step now reads error: target not found: ... instead of fel: Kunde inte hitta målet .... There is no construction that keeps the filter working and the errors translated, and the repo already takes the same trade for the much larger pacman -Syu, so this makes the keyring step consistent with it rather than introducing something new.

./test/cli passes against this branch on a worker VM (116 checks, exit 0). Nothing pushed to your branch.

A second opinion from codex at xhigh agreed with all of the above; its independence is not currently guaranteed, so read that as agreement rather than confirmation. It did raise one thing I had not looked at, which is pre-existing and not yours to fix: this script never checks pacman's exit status and has no set -e, so Keys are correct prints and the script returns 0 even when the keyring update failed — meaning omarchy-update's own set -e does not catch it either.

Waiting on the maintainer from here.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
…n any locale

pacman prints its 'up to date -- reinstalling' warning in the user's
locale, but the grep filter that hides it only matches the English
string. With LANG=sv_SE.UTF-8 the message leaked through on every
update. Force LC_ALL=C on the archlinux-keyring install so the message
is always English and the filter suppresses it.
@fldc
fldc force-pushed the fix/keyring-reinstall-warning-locale branch from 1069340 to ef20486 Compare September 28, 2026 09:13
The reinstall now runs as sudo env LC_ALL=C pacman, so the sudo stub matched nothing on it: the assertion on the exact reinstall command failed, and a failing reinstall could no longer be simulated. The stub now looks past env and its assignments, and the assertion requires LC_ALL=C, so the locale pin is covered rather than only tolerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Sep 28, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed after the rebase onto quattro. The fix still does what it says, but on quattro it broke test/shell.d/update-keyring-test.sh, so I pushed one commit to your branch to fix the test.

What was wrong. The test's sudo stub dispatches on $1 == "pacman" and asserts the exact reinstall command, sudo pacman -Sy --noconfirm archlinux-keyring. With sudo env LC_ALL=C pacman … the assertion failed, and the stub could no longer simulate a failed reinstall, so the case that checks a failed reinstall stops the script would have passed without testing anything. cdfdbba makes the stub look past env and its assignments, and makes the assertion require LC_ALL=C. The test now guards the fix: it passes on this branch and fails against quattro's script. The script itself is unchanged, and sudo env LC_ALL=… is the same form bin/omarchy-update-pacman uses to pass the locale through.

Verified on a disposable Omarchy worker (pacman 7.1.0) with sv_SE.UTF-8 generated, running the real script:

  • quattro: varning: archlinux-keyring-20260902-1 är senaste versionen -- återinstallerar leaks through on every run.
  • This branch: stderr is clean, and Keys are correct still prints.
  • With the change reverted, the warning comes back.
  • With the pacman database locked, the script still exits 1 on this branch, so the set -euo pipefail added on quattro still catches a failed reinstall. The only difference is that the error is now printed in English.

update-keyring-test.sh (6/6), update-disk-space, update-sequence, channel-sudo-boundary, update-user-path and update-lock all pass on the new head. ./test/cli stops at vscode generated theme references current theme file. That check fails the same way on quattro without this change, so it is not caused by this PR, but it means the full suite is not green. There are no CI checks on this pull request.

Codex at medium effort reviewed the script change and the test fix (read-only) and found nothing to change. It agreed with the points above; its independence from this review is not guaranteed.

For the maintainer: #13362 rewrites the same line of bin/omarchy-update-keyring to also reinstall archlinuxarm-keyring. It is not a competing fix, but whichever merges second will conflict with the other and needs LC_ALL=C carried over. Apart from that, this is waiting on the maintainer and the unrelated test/cli failure. Nothing is needed from you.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 10, 2026
quattro now reinstalls every signing keyring the machine trusts in one pacman call (Arch Linux ARM's and a platform's list beside Arch's), with a filter matching any keyring's reinstall warning. That filter is English-only like the one it replaced, so the pin moves onto the new call, and the new test cases expect it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 10, 2026
@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This PR appears safe to merge.

Summary

Pins pacman's locale with sudo env LC_ALL=C so the existing English warning filter works regardless of the user's locale.

  • The keyring refresh hides its up-to-date warning in every locale.

Reviews (4) · Last reviewed commit: "Merge quattro to keep the locale pin bes..." · Reviewed by Greptile

@omarchybot omarchybot added the ready Good to merge label Oct 10, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed after quattro moved under this branch. It had stopped merging cleanly, because quattro now reinstalls every signing keyring the machine trusts in one call (Arch Linux ARM's on aarch64 and a platform's list, beside Arch's) and widened the filter to any keyring's reinstall warning. That filter is still English-only, so your fix is still needed.

What I pushed. 5612106 merges quattro into your branch, keeping env LC_ALL=C on the new multi-keyring pacman -Sy call in bin/omarchy-update-keyring, and updates the new aarch64 and platform-list cases in test/shell.d/update-keyring-test.sh to expect the pinned command, as the existing case already did.

What was checked, on a disposable Omarchy worker (pacman 7.1.0) with sv_SE.UTF-8 generated, running the real script against the live repositories:

  • quattro: varning: archlinux-keyring-20260902-1 är senaste versionen -- återinstallerar leaks to stderr.
  • This head: stderr is empty, and stays empty in en_US.UTF-8.
  • This head with only env LC_ALL=C removed: the Swedish warning is back.
  • test/shell.d/update-keyring-test.sh: 9 passed, 0 failed. ./test/cli: green.

Second opinion. Codex Medium reviewed the merged head and found no defects: it confirmed the merge keeps all of quattro's keyring selection, that real pacman errors and its exit status still reach the caller, and that no other English-only filter of pacman output was missed. It read the source rather than running it, and agreed with conclusions already written down, so its independence is not guaranteed.

Nothing is left for you; this waits on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 12, 2026
quattro now refreshes the keyrings with --needed, so a current keyring prints "is up to date -- skipping" rather than "-- reinstalling". That notice is localized just the same, so the English-only filter still leaks it on a non-English system: the C locale goes on the new command, and the tests expect it there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 12, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed after quattro moved under this branch again. It had stopped merging cleanly because quattro now refreshes the keyrings with pacman -Sy --needed (#15034): a keyring that is already current prints "is up to date -- skipping" instead of "-- reinstalling", and the filter matches that line now. Pacman translates that notice too, so the bug this fixes is still there on quattro, just with different wording.

Pushed to your branch: 1050796 merges quattro. It keeps quattro's --needed command and its filter as they are, and runs that command as sudo env LC_ALL=C pacman .... The test assertions from quattro now expect the C locale on every keyring refresh. Your env handling in the test's sudo stub is unchanged.

Checked on a disposable Omarchy worker with sv_SE.UTF-8: quattro's script prints varning: archlinux-keyring-20260902-1 är senaste versionen -- hoppar över on every run. This branch prints nothing extra, in Swedish or in English. With LC_ALL=C removed, the Swedish line comes back. test/shell.d/update-keyring-test.sh (10/10), test/shell.d/update-sequence-test.sh (6/6) and ./test/cli all pass on the worker, and CI is green.

Second opinion: Codex Medium reviewed the merge and found nothing to change. It confirmed nothing from quattro was lost and that the fix is proportionate. It also noted that every message from this one pacman call is now English, errors included, which is the intended tradeoff. It had this review's reasoning in front of it, so its agreement is not guaranteed to be independent.

Nothing is left for you to do. This now waits on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 15, 2026
…otstrap

quattro now bootstraps and checks Arch Linux ARM's signing key before the keyring refresh (omacom#14820), and its new test cases assert the unpinned refresh command. Strip sudo env in the stub before the new gpg/pacman-key dispatch, and expect LC_ALL=C in the two new refresh assertions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 15, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed after quattro moved under this branch again. It had stopped merging cleanly because quattro now bootstraps and checks Arch Linux ARM's signing key before the keyring refresh (#14820). The refresh itself still runs with the user's locale and the filter is still English-only, so your fix is still needed.

Pushed to your branch: 781510f merges quattro. bin/omarchy-update-keyring keeps all of quattro's Arch Linux ARM key handling and runs the refresh as sudo env LC_ALL=C pacman ..., as before. In test/shell.d/update-keyring-test.sh, the sudo stub strips env before quattro's new key-trust dispatch, so the simulated archlinuxarm-keyring install still sees pacman. The two new refresh assertions now expect the C locale, like the others.

Checked on a disposable Omarchy worker (pacman 7.1.0) with sv_SE.UTF-8, running the real script:

  • quattro prints varning: archlinux-keyring-20260909-1 är senaste versionen -- hoppar över on every run.
  • This head prints nothing extra, in Swedish or in English.
  • With LC_ALL=C removed, the Swedish line comes back.
  • test/shell.d/update-keyring-test.sh passes 16/16, and fails with LC_ALL=C removed. test/shell.d/update-sequence-test.sh and ./test/cli pass. CI is green.

Second opinion: Codex Medium reviewed the merge read-only and found nothing to change. It confirmed that nothing from quattro was lost, that no quattro test now passes without testing anything because of the env form, and that the fix is proportionate. It had this review's conclusions in front of it, so its agreement is not guaranteed to be independent.

Nothing is left for you to do. This waits on the maintainer.

@omarchybot omarchybot removed the ready Good to merge label Nov 2, 2026
@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 3, 2026
quattro now refreshes omarchy-keyring with the Arch keyrings (omacom#17311) and adds Arch Linux ARM's key from a shipped copy rather than a keyserver (omacom#18508). Both rewrote the lines around the refresh, so the branch no longer merged. The refresh keeps quattro's command and heading and still runs as sudo env LC_ALL=C pacman, and every refresh assertion quattro changed expects the C locale.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 16, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed after quattro moved under this branch again. It had stopped merging cleanly because quattro now refreshes omarchy-keyring together with the Arch keyrings (#17311) and adds Arch Linux ARM's key from a shipped copy instead of a keyserver (#18508). The refresh still runs in the user's locale there and the filter is still English-only, so your fix is still needed. #18477 reports the same leak in French.

Pushed to your branch: e43b79a merges quattro. bin/omarchy-update-keyring takes all of quattro's changes and still runs the refresh as sudo env LC_ALL=C pacman ..., with your comment above it. In test/shell.d/update-keyring-test.sh, the seven refresh assertions quattro rewrote expect the C locale again, and your env handling in the sudo stub is unchanged.

Checked on a disposable Omarchy worker (pacman 7.1.0), running the real script under sv_SE.UTF-8, fr_FR.UTF-8 and en_US.UTF-8:

  • quattro prints varning: archlinux-keyring-20260909-1 är senaste versionen -- hoppar över and the same line for omarchy-keyring-20251027-1 on every run. In French it prints avertissement : archlinux-keyring-20260909-1 est à jour -- ignoré and the omarchy-keyring line, exactly as [Bug] Keyring update warnings not filtered with non-English locales #18477 shows.
  • This head prints nothing on stderr in any of the three locales, exits 0 and still ends with Keys are correct.
  • With only env LC_ALL=C removed, the Swedish and French lines come back.
  • test/shell.d/update-keyring-test.sh passes 16/16, and fails at the first refresh assertion with env LC_ALL=C removed. test/shell.d/update-sequence-test.sh and ./test/cli pass. CI is green on this head.

Second opinion: Codex Medium and muse-wonder (thinking high) each reviewed the merge read-only and found nothing to change. Both confirmed that nothing from quattro was lost, that every refresh assertion expects the pinned command, that no assertion passes without testing anything now that the logged command starts with env, and that the fix is proportionate to the problem. They had this review's worker results in front of them, so their agreement is not guaranteed to be independent.

Other pull requests for the same bug: #18620 and #18634, both opened on 12 November, make the same one-line change to the refresh. Both reviewers were asked which of the three should go forward, without being given an answer, and both named this one: it is the oldest, and neither newer one handles a case this one misses. #18620 does not update the test, which fails with its change. #18634's test differs only in exporting the env assignments inside the stub and unsetting LC_ALL, which changes nothing the test observes.

One thing for you, @fldc, if you have a minute: the description's ```diff block is never closed, so everything after it renders as code. That includes the Fixes #18477 line added today, which GitHub therefore does not read as a link, and the issue will not close when this merges. Closing the fence after the +sudo env ... line fixes that. The diff quoted there is also from before quattro changed the command (it shows --noconfirm archlinux-keyring and the "reinstalling" wording), so it no longer matches what this pull request changes.

The code needs nothing more from you. This waits on the maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Keyring update warnings not filtered with non-English locales

3 participants