diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2019-07-14 09:39:22 +0200 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2019-07-14 13:58:13 +0200 |
commit | 4205dedc323a25f9487d564935a47542396a1722 (patch) | |
tree | 353cb8891c48d4bb7a98676ac1bcf3a6ee37b038 /gen_funcs.sh | |
parent | gen_funcs.sh: Refactor check_distfiles() (diff) | |
download | genkernel-4205dedc323a25f9487d564935a47542396a1722.tar.gz genkernel-4205dedc323a25f9487d564935a47542396a1722.tar.bz2 genkernel-4205dedc323a25f9487d564935a47542396a1722.zip |
gen_funcs.sh: Refactor trap_cleanup()
- Restore output to make sure error message will be visible in case
trap was triggered while we were redirecting output to $LOGFILE.
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_funcs.sh')
-rwxr-xr-x | gen_funcs.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gen_funcs.sh b/gen_funcs.sh index 2dfa8ff..79daedf 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -903,6 +903,17 @@ tc-is-cross-compiler() { trap_cleanup() { # Call exit code of 1 for failure + if [ -t 0 ] + then + # try to restore output in case we were trapped while + # redirecting output... + exec &> /dev/tty + fi + + echo '' + print_error 1 "Genkernel was unexpectedly terminated." + print_error 1 "Please consult '${LOGFILE}' for more information and any" + print_error 1 "errors that were reported above." cleanup exit 1 } |