commit:     d1731fb1390dde14f02510e3f91901a340a6e9c9
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 16 18:20:49 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> 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 <floppym <AT> 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

Reply via email to