Gentoo Archives: gentoo-dev

From: Mike <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: Thu, 14 Apr 2022 23:15:31
Message-Id: 8e1bc0fe-154f-e6c2-9221-8d81ab709bd3@gentoo.org
In Reply to: [gentoo-dev] [PATCH v2] linux-info.eclass: Call ebegin, properly close with eend by Thomas Bracht Laumann Jespersen
1 On 4/13/22 06:05, Thomas Bracht Laumann Jespersen wrote:
2 > A recent QA check added to portage informs of eend being called without
3 > a preceding call to ebegin.
4 >
5 > This warning was emitted during pkg_setup for net-vpn/openvpn, and was
6 > traced back to the check_extra_config() function in linux-info.eclass.
7 >
8 > The preference is here to call ebegin (instead of dropping the lone
9 > eend) and in each of the possible exit branches for check_extra_config()
10 > call eend appropriately.
11 >
12 > Reported-by: Sam James <sam@g.o>
13 > Signed-off-by: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
14 > ---
15 >
16 > v1 -> v2:
17 > * Remove trailing "..." from call to ebegin - ebegin already outputs them
18 > * call "eend 1" in the soft errors case, instead of "eend 0"
19 >
20 > eclass/linux-info.eclass | 4 +++-
21 > 1 file changed, 3 insertions(+), 1 deletion(-)
22 >
23 > diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
24 > index 57b1f4c89ae..7b56a47016c 100644
25 > --- a/eclass/linux-info.eclass
26 > +++ b/eclass/linux-info.eclass
27 > @@ -781,7 +781,7 @@ check_extra_config() {
28 > require_configured_kernel
29 > fi
30 >
31 > - einfo "Checking for suitable kernel configuration options..."
32 > + ebegin "Checking for suitable kernel configuration options"
33 >
34 > for config in ${CONFIG_CHECK}
35 > do
36 > @@ -857,6 +857,7 @@ check_extra_config() {
37 > done
38 >
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 --
58 Mike Pagano
59 Gentoo Developer - Kernel Project
60 Gentoo Sources - Lead
61 E-Mail : mpagano@g.o
62 GnuPG FP : 52CC A0B0 F631 0B17 0142 F83F 92A6 DBEC 81F2 B137
63 Public Key : http://http://pgp.mit.edu/pks/lookup?search=0x92A6DBEC81F2B137&op=index

Replies

Subject Author
Re: [gentoo-dev] [PATCH v2] linux-info.eclass: Call ebegin, properly close with eend Thomas Bracht Laumann Jespersen <t@×××××××.xyz>