Browse Source

fix archlinux detection of available upgrades
note: checkupdates return 2 when no updates are available
(source: man page and source code)

Ludovic Bellier 3 years ago
parent
commit
7faa707d26
1 changed files with 2 additions and 1 deletions
  1. 2 1
      package-managers/upgrades-installed-check

+ 2 - 1
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