mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-15 01:48:34 -07:00
fix: version comparison in Arch keyring upgrade check
Replaces string comparison with proper version comparison using sort -V. This ensures correct handling of package versions like 1.2.3-1 vs 1.2.3-2.
This commit is contained in:
parent
6a5e4c3801
commit
7c85120799
@ -181,7 +181,8 @@ function upgrade() {
|
||||
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
|
||||
|
||||
if ! printf '%s\n' "$currentver" "$installedver" | sort -VC; then
|
||||
echo " Arch Linux PGP Keyring is out of date."
|
||||
echo " Updating before full system upgrade."
|
||||
sudo pacman -Sy --needed --noconfirm archlinux-keyring
|
||||
@ -189,6 +190,7 @@ function upgrade() {
|
||||
echo " Arch Linux PGP Keyring is up to date."
|
||||
echo " Proceeding with full system upgrade."
|
||||
fi
|
||||
|
||||
if (( $+commands[yay] )); then
|
||||
yay -Syu
|
||||
elif (( $+commands[trizen] )); then
|
||||
|
Loading…
Reference in New Issue
Block a user