Gentoo Archives: gentoo-dev

From: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
To: gentoo-dev@l.g.o
Cc: kernel@g.o, Thomas Bracht Laumann Jespersen <t@×××××××.xyz>, Sam James <sam@g.o>
Subject: [gentoo-dev] [PATCH v2] linux-info.eclass: Call ebegin, properly close with eend
Date: Wed, 13 Apr 2022 10:05:59
Message-Id: 20220413100535.12985-1-t@laumann.xyz
1 A recent QA check added to portage informs of eend being called without
2 a preceding call to ebegin.
3
4 This warning was emitted during pkg_setup for net-vpn/openvpn, and was
5 traced back to the check_extra_config() function in linux-info.eclass.
6
7 The preference is here to call ebegin (instead of dropping the lone
8 eend) and in each of the possible exit branches for check_extra_config()
9 call eend appropriately.
10
11 Reported-by: Sam James <sam@g.o>
12 Signed-off-by: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
13 ---
14
15 v1 -> v2:
16 * Remove trailing "..." from call to ebegin - ebegin already outputs them
17 * call "eend 1" in the soft errors case, instead of "eend 0"
18
19 eclass/linux-info.eclass | 4 +++-
20 1 file changed, 3 insertions(+), 1 deletion(-)
21
22 diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
23 index 57b1f4c89ae..7b56a47016c 100644
24 --- a/eclass/linux-info.eclass
25 +++ b/eclass/linux-info.eclass
26 @@ -781,7 +781,7 @@ check_extra_config() {
27 require_configured_kernel
28 fi
29
30 - einfo "Checking for suitable kernel configuration options..."
31 + ebegin "Checking for suitable kernel configuration options"
32
33 for config in ${CONFIG_CHECK}
34 do
35 @@ -857,6 +857,7 @@ check_extra_config() {
36 done
37
38 if [[ ${hard_errors_count} -gt 0 ]]; then
39 + eend 1
40 eerror "Please check to make sure these options are set correctly."
41 eerror "Failure to do so may cause unexpected problems."
42 eerror "Once you have satisfied these options, please try merging"
43 @@ -864,6 +865,7 @@ check_extra_config() {
44 export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
45 die "Incorrect kernel configuration options"
46 elif [[ ${soft_errors_count} -gt 0 ]]; then
47 + eend 1
48 ewarn "Please check to make sure these options are set correctly."
49 ewarn "Failure to do so may cause unexpected problems."
50 else
51 --
52 2.35.1

Replies