Add archlinux support to upgrade checker

(cherry picked from commit 9d10ec617878b018274dd20800434b2d3d35add5)
This commit is contained in:
Tray Torrance 2017-02-02 18:37:49 -08:00 committed by Nedyalko Andreev
parent 5daf11bf97
commit f28244ab47
No known key found for this signature in database
GPG Key ID: 3F8D3160C1860811

View File

@ -23,6 +23,13 @@ elif [ -e /etc/debian_version ]; then
apt_get_upgrade_output="$(LANG="C" apt-get -s upgrade 2>&1)"
exit_code="$?"
echo "$apt_get_upgrade_output" | awk "/^Inst/{ print $2 }" | [ "$(wc -L)" -eq 0 ] && echo "true" || echo "false"
elif [ -e /etc/arch-release ]; then
## Archlinux
set -e
set -o pipefail
checkupdates_output="$(checkupdates 2>&1)"
exit_code="$?"
echo "$checkupdates_output" | grep '->' | [ "$(wc -L)" -eq 0 ] && echo "true" || echo "false"
else
echo "Check not implemented for this distribution" >&2
exit 1