aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2022-07-03 14:52:09 -0400
committerMike Gilbert <floppym@gentoo.org>2022-07-03 14:58:37 -0400
commiteba088af8f335c0adb386461e6df1267e24800e7 (patch)
treebe80e0e76f79e869cffa203a133fb8ae0eaf7985
parentgit: mark repository as safe for newer gits (diff)
downloadportage-eba088af8f335c0adb386461e6df1267e24800e7.tar.gz
portage-eba088af8f335c0adb386461e6df1267e24800e7.tar.bz2
portage-eba088af8f335c0adb386461e6df1267e24800e7.zip
Revert "ebegin/eend: accept properly nested calls in different functions"
ebegin calls should not be nested: this will lead to strange looking output in the log file. For example: * Doing task 1 ... * Doint task 2 ... [ ok ] [ ok ] Reverts: 605ad0d675a64eb39144122cf284100192cdfea0 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
-rw-r--r--bin/isolated-functions.sh22
-rw-r--r--bin/phase-functions.sh4
2 files changed, 5 insertions, 21 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 848e44b04..dea0d7f49 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -340,15 +340,9 @@ ebegin() {
LAST_E_LEN=$(( 3 + ${#RC_INDENTATION} + ${#msg} ))
LAST_E_CMD="ebegin"
if [[ -v EBEGIN_EEND ]] ; then
- # Already a call to ebegin
- local prev="${EBEGIN_EEND[-1]}"
- if [[ "${prev}" == "${FUNCNAME[1]}" ]] ; then
- eqawarn "QA Notice: ebegin called in ${prev}, but missing call to eend (${FUNCNAME[1]})"
- fi
- EBEGIN_EEND+=( "${FUNCNAME[1]}" )
- else
- EBEGIN_EEND=( "${FUNCNAME[1]}" )
+ eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${EBUILD_PHASE})"
fi
+ EBEGIN_EEND=1
return 0
}
@@ -378,17 +372,9 @@ __eend() {
eend() {
[[ -n $1 ]] || eqawarn "QA Notice: eend called without first argument"
if [[ -v EBEGIN_EEND ]] ; then
- local caller="${FUNCNAME[1]}"
- local tos="${EBEGIN_EEND[-1]}"
- if [[ "${caller}" != "${tos}" ]] ; then
- eqawarn "QA Notice: eend (in ${caller}) improperly matched with ebegin (called in ${tos})"
- fi
- unset EBEGIN_EEND[-1]
- if [[ ${#EBEGIN_EEND[@]} -eq 0 ]] ; then
- unset EBEGIN_EEND
- fi
+ unset EBEGIN_EEND
else
- eqawarn "QA Notice: eend called without preceding ebegin (phase: ${FUNCNAME[1]})"
+ eqawarn "QA Notice: eend called without preceding ebegin (phase: ${EBUILD_PHASE})"
fi
local retval=${1:-0}
shift
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 0a36af297..25e25cc1e 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -1089,9 +1089,7 @@ __ebuild_main() {
esac
if [[ -v EBEGIN_EEND ]] ; then
- for func in "${EBEGIN_EEND[@]}" ; do
- eqawarn "QA Notice: ebegin called in ${func} but missing call to eend"
- done
+ eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${1})"
fi
# Save the env only for relevant phases.