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 8C1AE138334 for ; Mon, 15 Jul 2019 14:22:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D033EE08AD; Mon, 15 Jul 2019 14:22:07 +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 B6091E08AD for ; Mon, 15 Jul 2019 14:22:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 B8947347BDD for ; Mon, 15 Jul 2019 14:22:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 687526DB for ; Mon, 15 Jul 2019 14:22:05 +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: <1563200504.e04895cd0c01e2b39e33dabf1b42e51bc50cc9c4.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: e04895cd0c01e2b39e33dabf1b42e51bc50cc9c4 X-VCS-Branch: master Date: Mon, 15 Jul 2019 14:22:05 +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: a13e9ef7-62f0-4771-b4cb-5e8e3841eb44 X-Archives-Hash: 9c875882b2bd7376039084a1dd26ba47 commit: e04895cd0c01e2b39e33dabf1b42e51bc50cc9c4 Author: Thomas Deutschmann gentoo org> AuthorDate: Mon Jul 15 14:17:48 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Mon Jul 15 14:21:44 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=e04895cd gen_funcs.sh: trap_cleanup(): Log received signal Signed-off-by: Thomas Deutschmann gentoo.org> gen_funcs.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/gen_funcs.sh b/gen_funcs.sh index 4136122..caae87b 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -1041,8 +1041,21 @@ trap_cleanup() { exec &> /dev/tty fi + local signal_msg= + if [ -n "${GK_TRAP_SIGNAL}" ] + then + case "${GK_TRAP_SIGNAL}" in + SIGABRT|SIGHUP|SIGQUIT|SIGINT|SIGTERM) + signal_msg=" (signal ${GK_TRAP_SIGNAL} received)" + ;; + *) + signal_msg=" (unknown signal ${GK_TRAP_SIGNAL} received)" + ;; + esac + fi + echo '' - print_error 1 "Genkernel was unexpectedly terminated." + print_error 1 "Genkernel was unexpectedly terminated${signal_msg}." print_error 1 "Please consult '${LOGFILE}' for more information and any" print_error 1 "errors that were reported above." cleanup @@ -1236,7 +1249,11 @@ unpack() { } set_default_gk_trap() { - trap trap_cleanup SIGABRT SIGHUP SIGQUIT SIGINT SIGTERM + local signal + for signal in SIGABRT SIGHUP SIGQUIT SIGINT SIGTERM + do + trap "GK_TRAP_SIGNAL=${signal}; trap_cleanup" ${signal} + done } #