1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2025-05-22 15:48:06 +08:00

fix(archlinux): properly check keyring version (#12979)

This commit is contained in:
deimosian 2025-04-19 14:44:45 -04:00 committed by GitHub
parent 95a0ece8d3
commit b92874c716
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -178,26 +178,27 @@ fi
# Check Arch Linux PGP Keyring before System Upgrade to prevent failure.
function upgrade() {
sudo pacman -Sy
echo ":: Checking Arch Linux PGP Keyring..."
local installedver="$(LANG= sudo pacman -Qi archlinux-keyring | grep -Po '(?<=Version : ).*')"
local currentver="$(LANG= sudo pacman -Si archlinux-keyring | grep -Po '(?<=Version : ).*')"
if [ $installedver != $currentver ]; then
echo " Arch Linux PGP Keyring is out of date."
echo " Updating before full system upgrade."
sudo pacman -Sy --needed --noconfirm archlinux-keyring
sudo pacman -S --needed --noconfirm archlinux-keyring
else
echo " Arch Linux PGP Keyring is up to date."
echo " Proceeding with full system upgrade."
fi
if (( $+commands[yay] )); then
yay -Syu
yay -Su
elif (( $+commands[trizen] )); then
trizen -Syu
trizen -Su
elif (( $+commands[pacaur] )); then
pacaur -Syu
pacaur -Su
elif (( $+commands[aura] )); then
sudo aura -Syu
sudo aura -Su
else
sudo pacman -Syu
sudo pacman -Su
fi
}