Skip to content

Commit

Permalink
DEBUG: log stdout/err from updates check on Debian
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Dec 7, 2024
1 parent eb83bb7 commit 81954b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions package-managers/upgrades-installed-check
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ elif [ -e /etc/debian_version ]; then
set -e
set -o pipefail
# shellcheck disable=SC2034
apt_get_update_output="$(apt-get -q update 2>&1)"
apt_get_upgrade_output="$(LANG="C" apt-get -s upgrade 2>&1)"
apt_get_update_output="$(apt-get -q update 2>&1)" || { echo "$apt_get_update_output" >&2; exit 1; }
apt_get_upgrade_output="$(LANG="C" apt-get -s upgrade 2>&1)" || { echo "$apt_get_upgrade_output" >&2; exit 1; }
exit_code="$?"
# shellcheck disable=SC2266
echo "$apt_get_upgrade_output" | awk "/^Inst/{ print $2 }" | [ "$(wc -L)" -eq 0 ] && echo "true" || echo "false"
echo "$apt_get_update_output" >&2
echo "$apt_get_upgrade_output" >&2
elif [ -e /etc/arch-release ]; then
## Archlinux
checkupdates >/dev/null 2>&1
Expand Down

0 comments on commit 81954b6

Please sign in to comment.