code style fix

This commit is contained in:
Marek Marczykowski-Górecki 2018-12-05 05:46:51 +01:00
parent d92204e094
commit 8995993816
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 18 additions and 18 deletions

View File

@ -8,21 +8,21 @@
## Forwards the exit code of the package manager. ## Forwards the exit code of the package manager.
if [ -e /etc/system-release ]; then if [ -e /etc/system-release ]; then
## Fedora ## Fedora
# shellcheck disable=SC2034 # shellcheck disable=SC2034
yum_output="$(yum -q check-update 2>&1)" yum_output="$(yum -q check-update 2>&1)"
exit_code="$?" exit_code="$?"
[ "$exit_code" -eq 100 ] && echo "false" && exit 0 [ "$exit_code" -eq 100 ] && echo "false" && exit 0
[ "$exit_code" -eq 0 ] && echo "true" [ "$exit_code" -eq 0 ] && echo "true"
elif [ -e /etc/debian_version ]; then elif [ -e /etc/debian_version ]; then
## Debian ## Debian
set -e set -e
set -o pipefail set -o pipefail
# shellcheck disable=SC2034 # shellcheck disable=SC2034
apt_get_update_output="$(apt-get -q update 2>&1)" apt_get_update_output="$(apt-get -q update 2>&1)"
apt_get_upgrade_output="$(LANG="C" apt-get -s upgrade 2>&1)" apt_get_upgrade_output="$(LANG="C" apt-get -s upgrade 2>&1)"
exit_code="$?" exit_code="$?"
echo "$apt_get_upgrade_output" | awk "/^Inst/{ print $2 }" | [ "$(wc -L)" -eq 0 ] && echo "true" || echo "false" echo "$apt_get_upgrade_output" | awk "/^Inst/{ print $2 }" | [ "$(wc -L)" -eq 0 ] && echo "true" || echo "false"
elif [ -e /etc/arch-release ]; then elif [ -e /etc/arch-release ]; then
## Archlinux ## Archlinux
set -e set -e
@ -31,8 +31,8 @@ elif [ -e /etc/arch-release ]; then
exit_code="$?" exit_code="$?"
echo "$checkupdates_output" | grep -qF -- '->' && echo "false" || echo "true" echo "$checkupdates_output" | grep -qF -- '->' && echo "false" || echo "true"
else else
echo "Check not implemented for this distribution" >&2 echo "Check not implemented for this distribution" >&2
exit 1 exit 1
fi fi
exit "$exit_code" exit "$exit_code"

View File

@ -5,7 +5,7 @@ set -e
upgrades_installed="$(/usr/lib/qubes/upgrades-installed-check 2>&1)" upgrades_installed="$(/usr/lib/qubes/upgrades-installed-check 2>&1)"
if [ "$upgrades_installed" = "true" ]; then if [ "$upgrades_installed" = "true" ]; then
/usr/lib/qubes/qrexec-client-vm dom0 qubes.NotifyUpdates /bin/sh -c 'echo 0' /usr/lib/qubes/qrexec-client-vm dom0 qubes.NotifyUpdates /bin/sh -c 'echo 0'
elif [ "$upgrades_installed" = "false" ]; then elif [ "$upgrades_installed" = "false" ]; then
/usr/lib/qubes/qrexec-client-vm dom0 qubes.NotifyUpdates /bin/sh -c 'echo 1' /usr/lib/qubes/qrexec-client-vm dom0 qubes.NotifyUpdates /bin/sh -c 'echo 1'
fi fi