Gentoo Archives: gentoo-dev

From: Mike Pagano <mpagano@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH v2] linux-info.eclass: Call ebegin, properly close with eend
Date: Fri, 15 Apr 2022 12:17:03
Message-Id: 58cbad9e-1568-47b2-5f1e-1ca922054728@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH v2] linux-info.eclass: Call ebegin, properly close with eend by Thomas Bracht Laumann Jespersen
1 On 4/15/22 06:29, Thomas Bracht Laumann Jespersen wrote:
2 > On 14/04 19:15, Mike wrote:
3 >>
4 >> On 4/13/22 06:05, Thomas Bracht Laumann Jespersen wrote:
5 >>> A recent QA check added to portage informs of eend being called without
6 >>> a preceding call to ebegin.
7 >>>
8 >>> This warning was emitted during pkg_setup for net-vpn/openvpn, and was
9 >>> traced back to the check_extra_config() function in linux-info.eclass.
10 >>>
11 >>> The preference is here to call ebegin (instead of dropping the lone
12 >>> eend) and in each of the possible exit branches for check_extra_config()
13 >>> call eend appropriately.
14 >>>
15 >>> Reported-by: Sam James <sam@g.o>
16 >>> Signed-off-by: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
17 >>> ---
18 >>>
19 >>> v1 -> v2:
20 >>> * Remove trailing "..." from call to ebegin - ebegin already outputs them
21 >>> * call "eend 1" in the soft errors case, instead of "eend 0"
22 >>>
23 >>> eclass/linux-info.eclass | 4 +++-
24 >>> 1 file changed, 3 insertions(+), 1 deletion(-)
25 >>>
26 >>> diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
27 >>> index 57b1f4c89ae..7b56a47016c 100644
28 >>> --- a/eclass/linux-info.eclass
29 >>> +++ b/eclass/linux-info.eclass
30 >>> @@ -781,7 +781,7 @@ check_extra_config() {
31 >>> require_configured_kernel
32 >>> fi
33 >>> - einfo "Checking for suitable kernel configuration options..."
34 >>> + ebegin "Checking for suitable kernel configuration options"
35 >>> for config in ${CONFIG_CHECK}
36 >>> do
37 >>> @@ -857,6 +857,7 @@ check_extra_config() {
38 >>> done
39 >>> if [[ ${hard_errors_count} -gt 0 ]]; then
40 >>> + eend 1
41 >>> eerror "Please check to make sure these options are set correctly."
42 >>> eerror "Failure to do so may cause unexpected problems."
43 >>> eerror "Once you have satisfied these options, please try merging"
44 >>> @@ -864,6 +865,7 @@ check_extra_config() {
45 >>> export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
46 >>> die "Incorrect kernel configuration options"
47 >>> elif [[ ${soft_errors_count} -gt 0 ]]; then
48 >>> + eend 1
49 >>> ewarn "Please check to make sure these options are set correctly."
50 >>> ewarn "Failure to do so may cause unexpected problems."
51 >>> else
52 >>
53 >>
54 >> LGTM, I can commit this, after a reasonable amount of time with no further discussion.
55 >> Thanks for your contribution.
56 >
57 > Thanks! It's not perfect, I believe some of preceding lines may call eerror or
58 > ewarn before eend gets called, so there's still room for improvement.
59 >
60 > This change makes the QA notice go away though :-)
61 >
62 > -- Thomas
63 >
64
65 Committed
66
67 --
68 Mike Pagano
69 Gentoo Developer - Kernel Project
70 Gentoo Sources - Lead
71 E-Mail : mpagano@g.o
72 GnuPG FP : 52CC A0B0 F631 0B17 0142 F83F 92A6 DBEC 81F2 B137
73 Public Key : http://http://pgp.mit.edu/pks/lookup?search=0x92A6DBEC81F2B137&op=index