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] linux-info.eclass: Call ebegin, properly close with eend
Date: Wed, 13 Apr 2022 09:11:44
Message-Id: 20220413091127.30816-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 eclass/linux-info.eclass | 4 +++-
15 1 file changed, 3 insertions(+), 1 deletion(-)
16
17 diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
18 index 57b1f4c89ae..7c4b030b9f1 100644
19 --- a/eclass/linux-info.eclass
20 +++ b/eclass/linux-info.eclass
21 @@ -781,7 +781,7 @@ check_extra_config() {
22 require_configured_kernel
23 fi
24
25 - einfo "Checking for suitable kernel configuration options..."
26 + ebegin "Checking for suitable kernel configuration options..."
27
28 for config in ${CONFIG_CHECK}
29 do
30 @@ -857,6 +857,7 @@ check_extra_config() {
31 done
32
33 if [[ ${hard_errors_count} -gt 0 ]]; then
34 + eend 1
35 eerror "Please check to make sure these options are set correctly."
36 eerror "Failure to do so may cause unexpected problems."
37 eerror "Once you have satisfied these options, please try merging"
38 @@ -864,6 +865,7 @@ check_extra_config() {
39 export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
40 die "Incorrect kernel configuration options"
41 elif [[ ${soft_errors_count} -gt 0 ]]; then
42 + eend 0
43 ewarn "Please check to make sure these options are set correctly."
44 ewarn "Failure to do so may cause unexpected problems."
45 else
46 --
47 2.35.1

Replies