From cc351165dc78a8b7158a2b9bfdd9e4f0b3866239 Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Mon, 27 Feb 2017 19:36:38 +0000 Subject: [PATCH] apt-get-wrapper: - fix exit code handling - code simplification --- usr/lib/security-misc/apt-get-wrapper | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/usr/lib/security-misc/apt-get-wrapper b/usr/lib/security-misc/apt-get-wrapper index fe1f2ef..290dee2 100755 --- a/usr/lib/security-misc/apt-get-wrapper +++ b/usr/lib/security-misc/apt-get-wrapper @@ -19,19 +19,8 @@ logfile="$temp_dir/log" trap "cleanup" EXIT -## TODO -exec 2>&1 - -exec 3>&1 -exec 1> >(tee -a "$logfile") - -## TODO -#exec 4>&2 -#exec 2> >(tee -a "$logfile") - -unbuffer apt-get "$@" - -apt_get_exit_code="$?" +apt_get_exit_code="0" +unbuffer apt-get "$@" 1> >(tee -a "$logfile") 2> >(tee -a "$logfile" >&2) || { apt_get_exit_code="$?"; true; }; if [ ! "$apt_get_exit_code" = "0" ]; then exit "$apt_get_exit_code"