From 7faa707d26078517737facc14b451d5f46dbbd8b Mon Sep 17 00:00:00 2001 From: Ludovic Bellier Date: Sat, 28 Nov 2020 23:54:56 +0100 Subject: [PATCH] fix archlinux detection of available upgrades note: checkupdates return 2 when no updates are available (source: man page and source code) --- package-managers/upgrades-installed-check | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package-managers/upgrades-installed-check b/package-managers/upgrades-installed-check index 2222633..edd4a20 100755 --- a/package-managers/upgrades-installed-check +++ b/package-managers/upgrades-installed-check @@ -34,7 +34,8 @@ elif [ -e /etc/arch-release ]; then set -o pipefail checkupdates_output="$(checkupdates 2>&1)" exit_code="$?" - echo "$checkupdates_output" | grep -qF -- '->' && echo "false" || echo "true" + [ "$exit_code" -eq 2 ] && echo "true" && exit 0 + echo "false" elif [ -e /etc/gentoo-release ]; then ## Gentoo set -e