Gentoo Archives: gentoo-dev

From: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
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 10:30:01
Message-Id: 20220415102944.z4nirsxvznv3w7c6@sofaking
In Reply to: Re: [gentoo-dev] [PATCH v2] linux-info.eclass: Call ebegin, properly close with eend by Mike
1 On 14/04 19:15, Mike wrote:
2 >
3 > On 4/13/22 06:05, Thomas Bracht Laumann Jespersen wrote:
4 > > A recent QA check added to portage informs of eend being called without
5 > > a preceding call to ebegin.
6 > >
7 > > This warning was emitted during pkg_setup for net-vpn/openvpn, and was
8 > > traced back to the check_extra_config() function in linux-info.eclass.
9 > >
10 > > The preference is here to call ebegin (instead of dropping the lone
11 > > eend) and in each of the possible exit branches for check_extra_config()
12 > > call eend appropriately.
13 > >
14 > > Reported-by: Sam James <sam@g.o>
15 > > Signed-off-by: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
16 > > ---
17 > >
18 > > v1 -> v2:
19 > > * Remove trailing "..." from call to ebegin - ebegin already outputs them
20 > > * call "eend 1" in the soft errors case, instead of "eend 0"
21 > >
22 > > eclass/linux-info.eclass | 4 +++-
23 > > 1 file changed, 3 insertions(+), 1 deletion(-)
24 > >
25 > > diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
26 > > index 57b1f4c89ae..7b56a47016c 100644
27 > > --- a/eclass/linux-info.eclass
28 > > +++ b/eclass/linux-info.eclass
29 > > @@ -781,7 +781,7 @@ check_extra_config() {
30 > > require_configured_kernel
31 > > fi
32 > > - einfo "Checking for suitable kernel configuration options..."
33 > > + ebegin "Checking for suitable kernel configuration options"
34 > > for config in ${CONFIG_CHECK}
35 > > do
36 > > @@ -857,6 +857,7 @@ check_extra_config() {
37 > > done
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 >
53 > LGTM, I can commit this, after a reasonable amount of time with no further discussion.
54 > Thanks for your contribution.
55
56 Thanks! It's not perfect, I believe some of preceding lines may call eerror or
57 ewarn before eend gets called, so there's still room for improvement.
58
59 This change makes the QA notice go away though :-)
60
61 -- Thomas

Replies