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 6A1F1138335 for ; Sun, 21 Jul 2019 16:26:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A4F3FE0866; Sun, 21 Jul 2019 16:26:41 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 70C78E086A for ; Sun, 21 Jul 2019 16:26:41 +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 7A6043483EE for ; Sun, 21 Jul 2019 16:26:40 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A4709738 for ; Sun, 21 Jul 2019 16:26:37 +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: <1563724071.0e65a9e6769cbcd3f59cd5facb15ac03983f4859.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: 0e65a9e6769cbcd3f59cd5facb15ac03983f4859 X-VCS-Branch: master Date: Sun, 21 Jul 2019 16:26:37 +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: e73a0f89-7bd1-47bf-b5bd-192fbfe6396e X-Archives-Hash: 9a1c38a5444257f32a7b0f5a99d958c9 commit: 0e65a9e6769cbcd3f59cd5facb15ac03983f4859 Author: Thomas Deutschmann gentoo org> AuthorDate: Sat Jul 20 21:23:47 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Jul 21 15:47:51 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=0e65a9e6 gen_funcs.sh: dump_debugcache(): Echo DEBUGCACHE when $LOGFILE isn't writable This can happen until determine_real_args() was called. Signed-off-by: Thomas Deutschmann gentoo.org> gen_funcs.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gen_funcs.sh b/gen_funcs.sh index de8cd7f..0277eb2 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -44,7 +44,15 @@ set_color_vars dump_debugcache() { TODEBUGCACHE=no - echo "${DEBUGCACHE}" >> "${LOGFILE}" + + if [ -w "${LOGFILE}" ] + then + echo "${DEBUGCACHE}" >> "${LOGFILE}" + else + echo "WARNING: Cannot write to '${LOGFILE}'!" + echo "${DEBUGCACHE}" + fi + DEBUGCACHE= }