mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-02-02 15:14:46 -05:00
use python rather than unbuffer
because unbuffer eats exit code when process is killed
This commit is contained in:
parent
cc351165dc
commit
2130b4c654
4
debian/control
vendored
4
debian/control
vendored
@ -1,4 +1,4 @@
|
|||||||
## Copyright (C) 2012 - 2014 Patrick Schleizer <adrelanos@riseup.net>
|
## Copyright (C) 2012 - 2017 Patrick Schleizer <adrelanos@riseup.net>
|
||||||
## See the file COPYING for copying conditions.
|
## See the file COPYING for copying conditions.
|
||||||
|
|
||||||
Source: security-misc
|
Source: security-misc
|
||||||
@ -13,7 +13,7 @@ Standards-Version: 3.9.8
|
|||||||
|
|
||||||
Package: security-misc
|
Package: security-misc
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Depends: expect, tcl8.6, ${misc:Depends}
|
Depends: python, ${misc:Depends}
|
||||||
Replaces: tcp-timestamps-disable
|
Replaces: tcp-timestamps-disable
|
||||||
Description: enhances misc security settings
|
Description: enhances misc security settings
|
||||||
The following settings are changed:
|
The following settings are changed:
|
||||||
|
@ -20,12 +20,18 @@ logfile="$temp_dir/log"
|
|||||||
trap "cleanup" EXIT
|
trap "cleanup" EXIT
|
||||||
|
|
||||||
apt_get_exit_code="0"
|
apt_get_exit_code="0"
|
||||||
unbuffer apt-get "$@" 1> >(tee -a "$logfile") 2> >(tee -a "$logfile" >&2) || { apt_get_exit_code="$?"; true; };
|
|
||||||
|
python -c 'import pty, sys; pty.spawn(sys.argv[1:])' \
|
||||||
|
| apt-get "$@" 2>&1 \
|
||||||
|
| tee -a "$logfile" \
|
||||||
|
|| { apt_get_exit_code="$?"; true; };
|
||||||
|
|
||||||
if [ ! "$apt_get_exit_code" = "0" ]; then
|
if [ ! "$apt_get_exit_code" = "0" ]; then
|
||||||
exit "$apt_get_exit_code"
|
exit "$apt_get_exit_code"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
log="$(cat "$logfile")"
|
||||||
|
|
||||||
while read -r -d $'\n' line; do
|
while read -r -d $'\n' line; do
|
||||||
line_lower_case="${line,,}"
|
line_lower_case="${line,,}"
|
||||||
first_two="${line_lower_case:0:2}"
|
first_two="${line_lower_case:0:2}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user