Fix updates checking on Fedora with dnf

yum wrapper may not be installed anymore

QubesOS/qubes-issues#2009
This commit is contained in:
Marek Marczykowski-Górecki 2018-12-05 05:48:00 +01:00
parent 8995993816
commit bb28efe628
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -9,8 +9,13 @@
if [ -e /etc/system-release ]; then
## Fedora
if command -v dnf >/dev/null; then
yum=dnf
else
yum=yum
fi
# shellcheck disable=SC2034
yum_output="$(yum -q check-update 2>&1)"
yum_output="$($yum -q check-update 2>&1)"
exit_code="$?"
[ "$exit_code" -eq 100 ] && echo "false" && exit 0
[ "$exit_code" -eq 0 ] && echo "true"