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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1C82D158086 for ; Fri, 19 Nov 2021 16:17:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A6267E07B2; Fri, 19 Nov 2021 16:17:36 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D0CF9E0536 for ; Fri, 19 Nov 2021 16:17:35 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 267B13430B5 for ; Fri, 19 Nov 2021 16:17:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7C72F1BC for ; Fri, 19 Nov 2021 16:17:32 +0000 (UTC) From: "Mike Gilbert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Gilbert" Message-ID: <1637338564.d1731fb1390dde14f02510e3f91901a340a6e9c9.floppym@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/ebuild.sh bin/isolated-functions.sh X-VCS-Directories: bin/ X-VCS-Committer: floppym X-VCS-Committer-Name: Mike Gilbert X-VCS-Revision: d1731fb1390dde14f02510e3f91901a340a6e9c9 X-VCS-Branch: master Date: Fri, 19 Nov 2021 16:17:32 +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: 8621c36c-afb0-4869-960d-647108ec7994 X-Archives-Hash: 8ae352b6b0381e426d2e13df5530077d commit: d1731fb1390dde14f02510e3f91901a340a6e9c9 Author: Mike Gilbert gentoo org> AuthorDate: Tue Nov 16 18:20:49 2021 +0000 Commit: Mike Gilbert gentoo org> CommitDate: Fri Nov 19 16:16:04 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d1731fb1 Move debug-print to isolated-functions.sh This allows it to be called from various helpers. Signed-off-by: Mike Gilbert gentoo.org> bin/ebuild.sh | 39 --------------------------------------- bin/isolated-functions.sh | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 07ca58d22..ba406034b 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -198,45 +198,6 @@ fi #(not secretive, but not stupid) umask 022 -# debug-print() gets called from many places with verbose status information useful -# for tracking down problems. The output is in $T/eclass-debug.log. -# You can set ECLASS_DEBUG_OUTPUT to redirect the output somewhere else as well. -# The special "on" setting echoes the information, mixing it with the rest of the -# emerge output. -# You can override the setting by exporting a new one from the console, or you can -# set a new default in make.*. Here the default is "" or unset. - -# in the future might use e* from /etc/init.d/functions.sh if i feel like it -debug-print() { - # if $T isn't defined, we're in dep calculation mode and - # shouldn't do anything - [[ $EBUILD_PHASE = depend || ! -d ${T} || ${#} -eq 0 ]] && return 0 - - if [[ ${ECLASS_DEBUG_OUTPUT} == on ]]; then - printf 'debug: %s\n' "${@}" >&2 - elif [[ -n ${ECLASS_DEBUG_OUTPUT} ]]; then - printf 'debug: %s\n' "${@}" >> "${ECLASS_DEBUG_OUTPUT}" - fi - - if [[ -w $T ]] ; then - # default target - printf '%s\n' "${@}" >> "${T}/eclass-debug.log" - # let the portage user own/write to this file - chgrp "${PORTAGE_GRPNAME:-portage}" "${T}/eclass-debug.log" - chmod g+w "${T}/eclass-debug.log" - fi -} - -# The following 2 functions are debug-print() wrappers - -debug-print-function() { - debug-print "${1}: entering function, parameters: ${*:2}" -} - -debug-print-section() { - debug-print "now in section ${*}" -} - # Sources all eclasses in parameters declare -ix ECLASS_DEPTH=0 inherit() { diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index df806d403..6d9b73474 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -609,4 +609,43 @@ else } fi +# debug-print() gets called from many places with verbose status information useful +# for tracking down problems. The output is in $T/eclass-debug.log. +# You can set ECLASS_DEBUG_OUTPUT to redirect the output somewhere else as well. +# The special "on" setting echoes the information, mixing it with the rest of the +# emerge output. +# You can override the setting by exporting a new one from the console, or you can +# set a new default in make.*. Here the default is "" or unset. + +# in the future might use e* from /etc/init.d/functions.sh if i feel like it +debug-print() { + # if $T isn't defined, we're in dep calculation mode and + # shouldn't do anything + [[ $EBUILD_PHASE = depend || ! -d ${T} || ${#} -eq 0 ]] && return 0 + + if [[ ${ECLASS_DEBUG_OUTPUT} == on ]]; then + printf 'debug: %s\n' "${@}" >&2 + elif [[ -n ${ECLASS_DEBUG_OUTPUT} ]]; then + printf 'debug: %s\n' "${@}" >> "${ECLASS_DEBUG_OUTPUT}" + fi + + if [[ -w $T ]] ; then + # default target + printf '%s\n' "${@}" >> "${T}/eclass-debug.log" + # let the portage user own/write to this file + chgrp "${PORTAGE_GRPNAME:-portage}" "${T}/eclass-debug.log" + chmod g+w "${T}/eclass-debug.log" + fi +} + +# The following 2 functions are debug-print() wrappers + +debug-print-function() { + debug-print "${1}: entering function, parameters: ${*:2}" +} + +debug-print-section() { + debug-print "now in section ${*}" +} + true