Skip to content

Filter keyring update warnings in non-English locales - #18634

Closed
AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:fix/issue-18477
Closed

AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:fix/issue-18477

Conversation

@AnPod

@AnPod AnPod commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #18477

Problem

On non-English locales (e.g. fr_FR.UTF-8) the Update signing keys stage of omarchy update leaks localized pacman notices through the stderr filter in bin/omarchy-update-keyring:

avertissement : archlinux-keyring-20260909-1 est à jour -- ignoré

The filter only matches the English wording (^warning: …-keyring-… is up to date -- skipping$), so any non-English locale turns the expected silence into warning spam.

Fix

Pin the locale of that one pacman call: sudo pacman -Sy … → sudo env LC_ALL=C pacman -Sy … (bin/omarchy-update-keyring:95). LC_ALL overrides LANG and every LC_* category, so pacman's stderr is guaranteed English and the existing filter keeps matching regardless of the caller's locale. The user's system locale is untouched everywhere else.

The bootstrap-path sudo pacman -Sy (line 33) deliberately keeps no LC_ALL=C — it has no filter, so there is nothing to keep English. The other sudo calls (pacman-key --add/--lsign-key/--populate/--list-keys, gpg --homedir …) are untouched.

Test

  • test/shell.d/update-keyring-test.sh: the sudo stub now logs env/VAR=value argv and the LC_ALL it sees exported in its own environment; every keyring-refresh argv assertion now requires env LC_ALL=C; a new assertion proves the C locale actually reaches the child environment of the refresh — and only of the refresh (populate/--add/--lsign-key over-application is guarded by the existing exact argv assertions). Ambient LC_ALL is unset in the test process so the new check cannot pass vacuously. 17/17 assertions pass; the suite fails at exactly the new assertion with the script change reverted (red-check).
  • bash -n on both files.

@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; both previous findings are addressed.

Summary

Pins the filtered pacman refresh to LC_ALL=C so notices match the English-only filter regardless of the user's locale.

  • The keyring refresh keeps routine up-to-date notices quiet in every locale.

Reviews (2) · Last reviewed commit: "test: stop asserting the sudo stub's LC_..." · Reviewed by Greptile

Comment thread test/shell.d/update-keyring-test.sh Resolved
Comment thread test/shell.d/update-keyring-test.sh Resolved

@manuaudio manuaudio 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.

AI-assisted test run (an agent ran these, not a hand test) on Omarchy 4.0.4 (x86_64, pacman 7.1.0), with this PR at e9fa3eb.

  • bash test/shell.d/update-keyring-test.sh: 16/16 ok on quattro (ac6cb9c), 17/17 ok on this PR. With this PR's test but the old bin/omarchy-update-keyring, it fails at "update-keyring forces the C locale on the keyring refresh", so the new assertion does catch the missing change.
  • Real pacman, against a copy of the local database (fakeroot pacman -S --needed --noconfirm --dbpath <copy> omarchy-keyring), with French messages and stderr piped through the script's grep filter:
    • as on quattro: avertissement : omarchy-keyring-20251027-1 est à jour -- ignoré gets through the filter
    • with env LC_ALL=C as in this PR: that line is filtered out
  • French messages came from LANGUAGE=fr under LANG=en_US.UTF-8, because the test machine has no fr_FR locale generated. LC_ALL=C overrides that too. Not tested: a real sudo pacman -Sy refresh, or an actual fr_FR.UTF-8 locale.

…yle in stub loop

Addresses greptile P2 findings on PR omacom#18634.
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for tracking this down, @AnPod. This is the same fix as #7609, which was opened in August against quattro and is still open, so I'm closing this one as a duplicate in favour of the older one.

What makes them the same: both change the one keyring refresh in bin/omarchy-update-keyring to sudo env LC_ALL=C pacman -Sy --needed --noconfirm ... and leave the English-only filter as it is. Both update the same seven refresh assertions in test/shell.d/update-keyring-test.sh to expect env LC_ALL=C, and both make the test's sudo stub skip past env and its assignments. Both fix #18477. #7609 has already been run on a disposable Omarchy worker under fr_FR.UTF-8 and sv_SE.UTF-8: on quattro the localized "up to date" lines leak through, with the fix stderr is empty, and with the pin reverted they come back. Its CI is green.

The only parts here that #7609 lacks are unset LC_ALL and the stub exporting the assignments. They supported the child-environment assertion that 2673ff9 removed, and nothing reads them now, so closing this loses nothing. The PR description still describes that assertion and 17 passing checks.

Who checked: Claude Opus 5.5 compared the two diffs against quattro. Codex Medium was then asked separately, shown only the two pull requests, and agreed they are the same change. Its independence from the first review isn't guaranteed.

If I've got this wrong and something here is missing from #7609, say so and it can be reopened.

@omarchybot omarchybot added the duplicate This issue or pull request already exists label Nov 17, 2026
@omarchybot omarchybot closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working duplicate This issue or pull request already exists

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