Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: bin/
Date: Sun, 03 Jul 2022 19:36:42
Message-Id: 1656874717.eba088af8f335c0adb386461e6df1267e24800e7.floppym@gentoo
1 commit: eba088af8f335c0adb386461e6df1267e24800e7
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 3 18:52:09 2022 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 3 18:58:37 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=eba088af
7
8 Revert "ebegin/eend: accept properly nested calls in different functions"
9
10 ebegin calls should not be nested: this will lead to strange looking
11 output in the log file. For example:
12
13 * Doing task 1 ...
14 * Doint task 2 ... [ ok ]
15 [ ok ]
16
17 Reverts: 605ad0d675a64eb39144122cf284100192cdfea0
18 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
19
20 bin/isolated-functions.sh | 22 ++++------------------
21 bin/phase-functions.sh | 4 +---
22 2 files changed, 5 insertions(+), 21 deletions(-)
23
24 diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
25 index 848e44b04..dea0d7f49 100644
26 --- a/bin/isolated-functions.sh
27 +++ b/bin/isolated-functions.sh
28 @@ -340,15 +340,9 @@ ebegin() {
29 LAST_E_LEN=$(( 3 + ${#RC_INDENTATION} + ${#msg} ))
30 LAST_E_CMD="ebegin"
31 if [[ -v EBEGIN_EEND ]] ; then
32 - # Already a call to ebegin
33 - local prev="${EBEGIN_EEND[-1]}"
34 - if [[ "${prev}" == "${FUNCNAME[1]}" ]] ; then
35 - eqawarn "QA Notice: ebegin called in ${prev}, but missing call to eend (${FUNCNAME[1]})"
36 - fi
37 - EBEGIN_EEND+=( "${FUNCNAME[1]}" )
38 - else
39 - EBEGIN_EEND=( "${FUNCNAME[1]}" )
40 + eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${EBUILD_PHASE})"
41 fi
42 + EBEGIN_EEND=1
43 return 0
44 }
45
46 @@ -378,17 +372,9 @@ __eend() {
47 eend() {
48 [[ -n $1 ]] || eqawarn "QA Notice: eend called without first argument"
49 if [[ -v EBEGIN_EEND ]] ; then
50 - local caller="${FUNCNAME[1]}"
51 - local tos="${EBEGIN_EEND[-1]}"
52 - if [[ "${caller}" != "${tos}" ]] ; then
53 - eqawarn "QA Notice: eend (in ${caller}) improperly matched with ebegin (called in ${tos})"
54 - fi
55 - unset EBEGIN_EEND[-1]
56 - if [[ ${#EBEGIN_EEND[@]} -eq 0 ]] ; then
57 - unset EBEGIN_EEND
58 - fi
59 + unset EBEGIN_EEND
60 else
61 - eqawarn "QA Notice: eend called without preceding ebegin (phase: ${FUNCNAME[1]})"
62 + eqawarn "QA Notice: eend called without preceding ebegin (phase: ${EBUILD_PHASE})"
63 fi
64 local retval=${1:-0}
65 shift
66
67 diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
68 index 0a36af297..25e25cc1e 100644
69 --- a/bin/phase-functions.sh
70 +++ b/bin/phase-functions.sh
71 @@ -1089,9 +1089,7 @@ __ebuild_main() {
72 esac
73
74 if [[ -v EBEGIN_EEND ]] ; then
75 - for func in "${EBEGIN_EEND[@]}" ; do
76 - eqawarn "QA Notice: ebegin called in ${func} but missing call to eend"
77 - done
78 + eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${1})"
79 fi
80
81 # Save the env only for relevant phases.