From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7AC2B138334 for ; Fri, 26 Jul 2019 16:31:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F1711E0828; Fri, 26 Jul 2019 16:31:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A1ED6E0828 for ; Fri, 26 Jul 2019 16:31:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 12CDA348C19 for ; Fri, 26 Jul 2019 16:31:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 805341BA for ; Fri, 26 Jul 2019 16:31:28 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1564157621.9595cfa3498003ca3d5f53aade101f271b3dca24.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_funcs.sh X-VCS-Directories: / X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 9595cfa3498003ca3d5f53aade101f271b3dca24 X-VCS-Branch: master Date: Fri, 26 Jul 2019 16:31:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: fbf4bbdf-f0c1-426c-a49a-f0ce064a6796 X-Archives-Hash: 36a64745de8dec105766efef53f4bdc1 commit: 9595cfa3498003ca3d5f53aade101f271b3dca24 Author: Thomas Deutschmann gentoo org> AuthorDate: Fri Jul 26 16:12:01 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Fri Jul 26 16:13:41 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=9595cfa3 gen_funcs.sh: gen_die(): Just trigger trap function when died in subshell This will ensure that only one function will call cleanup(). Signed-off-by: Thomas Deutschmann gentoo.org> gen_funcs.sh | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/gen_funcs.sh b/gen_funcs.sh index 94bf550..97a85dd 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -282,26 +282,31 @@ gen_die() { print_error 1 "ERROR: ${1}" fi - # Don't trust $LOGFILE before determine_real_args() was called - if [ -n "${CMD_LOGFILE}" -a -s "${LOGFILE}" ] + if [[ -n "${GK_MASTER_PID}" && ${BASHPID} != ${GK_MASTER_PID} ]] then - print_error 1 "Please consult '${LOGFILE}' for more information and any" - print_error 1 "errors that were reported above." - print_error 1 '' - fi + # We died in a subshell! Let's trigger trap function... + kill -s SIGTERM ${GK_MASTER_PID} + else + # Don't trust $LOGFILE before determine_real_args() was called + if [ -n "${CMD_LOGFILE}" -a -s "${LOGFILE}" ] + then + print_error 1 "Please consult '${LOGFILE}' for more information and any" + print_error 1 "errors that were reported above." + print_error 1 '' + fi - print_error 1 "Report any genkernel bugs to bugs.gentoo.org and" - print_error 1 "assign your bug to genkernel@gentoo.org. Please include" - print_error 1 "as much information as you can in your bug report; attaching" - print_error 1 "'${LOGFILE}' so that your issue can be dealt with effectively." - print_error 1 '' - print_error 1 "Please do ${BOLD}*not*${NORMAL} report ${BOLD}kernel${NORMAL} compilation failures as genkernel bugs!" - print_error 1 '' + print_error 1 "Report any genkernel bugs to bugs.gentoo.org and" + print_error 1 "assign your bug to genkernel@gentoo.org. Please include" + print_error 1 "as much information as you can in your bug report; attaching" + print_error 1 "'${LOGFILE}' so that your issue can be dealt with effectively." + print_error 1 '' + print_error 1 "Please do ${BOLD}*not*${NORMAL} report ${BOLD}kernel${NORMAL} compilation failures as genkernel bugs!" + print_error 1 '' - # Cleanup temp dirs and caches if requested - cleanup + # Cleanup temp dirs and caches if requested + cleanup + fi - [[ -n "${GK_MASTER_PID}" && ${BASHPID} != ${GK_MASTER_PID} ]] && kill -s SIGTERM ${GK_MASTER_PID} exit 1 }