mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-01-11 13:39:28 -05:00
apt-get-wrapper:
- fix exit code handling - code simplification
This commit is contained in:
parent
1fb48e3548
commit
cc351165dc
@ -19,19 +19,8 @@ logfile="$temp_dir/log"
|
|||||||
|
|
||||||
trap "cleanup" EXIT
|
trap "cleanup" EXIT
|
||||||
|
|
||||||
## TODO
|
apt_get_exit_code="0"
|
||||||
exec 2>&1
|
unbuffer apt-get "$@" 1> >(tee -a "$logfile") 2> >(tee -a "$logfile" >&2) || { apt_get_exit_code="$?"; true; };
|
||||||
|
|
||||||
exec 3>&1
|
|
||||||
exec 1> >(tee -a "$logfile")
|
|
||||||
|
|
||||||
## TODO
|
|
||||||
#exec 4>&2
|
|
||||||
#exec 2> >(tee -a "$logfile")
|
|
||||||
|
|
||||||
unbuffer apt-get "$@"
|
|
||||||
|
|
||||||
apt_get_exit_code="$?"
|
|
||||||
|
|
||||||
if [ ! "$apt_get_exit_code" = "0" ]; then
|
if [ ! "$apt_get_exit_code" = "0" ]; then
|
||||||
exit "$apt_get_exit_code"
|
exit "$apt_get_exit_code"
|
||||||
|
Loading…
Reference in New Issue
Block a user