Merge pull request #7807 from Adolanium/keyring-fail-loud
Stop update-keyring from claiming success when key operations fail
This commit is contained in:
1 parent
f2b419d9a9
commit
49418942c8
2 files changed
+146
No files matched your search
@@ -3,6 +3,11 @@
|
||||
# omarchy:summary=Ensure the Omarchy and Arch keyring packages are installed and populated
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
# omarchy-update runs this under set -e as a trusted pre-step, so a failed recv
|
||||
# or a broken keyring has to stop this script here, not surface later as
|
||||
# signature errors in the middle of the main transaction.
|
||||
set -euo pipefail
|
||||
|
||||
if omarchy-pkg-missing omarchy-keyring || ! sudo pacman-key --list-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 &>/dev/null; then
|
||||
sudo pacman-key --recv-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 --keyserver keys.openpgp.org
|
||||
sudo pacman-key --lsign-key 40DFB630FF42BCFFB047046CF0134EE680CAC571
|
||||
@@ -19,4 +24,8 @@ fi
|
||||
# Always reinstall, as the keyring can be updated without a package version bump.
|
||||
echo -e "\e[32m\nUpdate Arch signing keys\e[0m"
|
||||
sudo pacman -Sy --noconfirm archlinux-keyring >/dev/null 2> >(grep -vE '^warning: archlinux-keyring-[^ ]+ is up to date -- reinstalling$' >&2)
|
||||
|
||||
# Say "correct" only once the key verifiably is: before the failure checks
|
||||
# above, a failed recv or reinstall still ended here with exit 0.
|
||||
sudo pacman-key --list-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 >/dev/null
|
||||
echo "Keys are correct"
|
||||
Reference in new issue
Block a user