From f76d058a6d984f91241c09efaf895067152dfbdc Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 7 Aug 2026 23:52:24 +0200 Subject: [PATCH] Force a database refresh before installing keyrings during the Quattro upgrade (#6615) The upgrade repoints the mirrorlist and the [omarchy] server, then ran pacman -Sy. A plain -Sy keeps the legacy database whenever the new server's copy isn't newer, so the checksums stay stale and every re-download of a rebuilt package aborts as corrupted. Fixes #6576 Co-authored-by: Claude Opus 5 --- bin/omarchy-upgrade-to-quattro | 9 +++++++-- test/shell.d/upgrade-to-quattro-test.sh | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bin/omarchy-upgrade-to-quattro b/bin/omarchy-upgrade-to-quattro index 15408273..56707457 100755 --- a/bin/omarchy-upgrade-to-quattro +++ b/bin/omarchy-upgrade-to-quattro @@ -402,11 +402,16 @@ install_keyrings() { # database's checksum and abort --noconfirm transactions as "corrupted". as_root find /var/cache/pacman/pkg -maxdepth 1 -name 'omarchy-*' -delete 2>/dev/null || true - as_root pacman -Sy --noconfirm archlinux-keyring omarchy-keyring || { + # -Syy forces the database download. configure_pacman_channel just repointed + # the mirrors, and a plain -Sy keeps the legacy database whenever the new + # server's copy isn't newer, leaving stale checksums that no amount of + # re-downloading can satisfy. + + as_root pacman -Syy --noconfirm archlinux-keyring omarchy-keyring || { warn "Keyring package install failed; attempting to trust the Omarchy packaging key directly." as_root pacman-key --recv-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 --keyserver keys.openpgp.org || true as_root pacman-key --lsign-key 40DFB630FF42BCFFB047046CF0134EE680CAC571 || true - as_root pacman -Sy --noconfirm archlinux-keyring omarchy-keyring + as_root pacman -Syy --noconfirm archlinux-keyring omarchy-keyring } } diff --git a/test/shell.d/upgrade-to-quattro-test.sh b/test/shell.d/upgrade-to-quattro-test.sh index d601e03f..2da1006f 100644 --- a/test/shell.d/upgrade-to-quattro-test.sh +++ b/test/shell.d/upgrade-to-quattro-test.sh @@ -13,6 +13,14 @@ pacman_line=$(grep -n '^configure_pacman_channel$' "$upgrade_to_quattro" | cut - grep -F 'omarchy-snapshot create || (($? == 127))' "$upgrade_to_quattro" >/dev/null pass "Omarchy 4 upgrade snapshots the system before mutation" +# The mirrors are repointed immediately before the keyrings go in, so only a +# forced refresh replaces the legacy database and its stale checksums. +grep -F 'pacman -Syy --noconfirm archlinux-keyring omarchy-keyring' "$upgrade_to_quattro" >/dev/null +if grep -F 'pacman -Sy --noconfirm archlinux-keyring omarchy-keyring' "$upgrade_to_quattro" >/dev/null; then + fail "Omarchy 4 upgrade forces a database refresh before installing keyrings" +fi +pass "Omarchy 4 upgrade forces a database refresh before installing keyrings" + grep -F 'pacman -Syu --needed' "$upgrade_to_quattro" >/dev/null grep -F 'omarchy-update-aur-pkgs' "$upgrade_to_quattro" >/dev/null grep -F 'omarchy-update-available' "$upgrade_to_quattro" >/dev/null