Gentoo Archives: gentoo-dev

From: Ionen Wolkens <ionen@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH v2] python-utils-r1.eclass: avoid nested ebegin calls
Date: Mon, 11 Jul 2022 16:11:32
Message-Id: YsxLrKtyQ8gZkSvI@eversor
In Reply to: [gentoo-dev] [PATCH v2] python-utils-r1.eclass: avoid nested ebegin calls by Mike Gilbert
1 On Mon, Jul 11, 2022 at 09:16:10AM -0400, Mike Gilbert wrote:
2 > It's common for python_check_deps to call python_has_version, which
3 > calls ebegin itself.
4 >
5 > Signed-off-by: Mike Gilbert <floppym@g.o>
6 > ---
7 > eclass/python-utils-r1.eclass | 9 ++++++---
8 > 1 file changed, 6 insertions(+), 3 deletions(-)
9 >
10 > diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
11 > index a18ca58475f..5c678c524ae 100644
12 > --- a/eclass/python-utils-r1.eclass
13 > +++ b/eclass/python-utils-r1.eclass
14 > @@ -1399,9 +1399,12 @@ _python_run_check_deps() {
15 >
16 > local PYTHON_USEDEP="python_targets_${impl}(-)"
17 > local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)"
18 > - ebegin " python_check_deps"
19 > - python_check_deps
20 > - eend ${?}
21 > + einfo " python_check_deps"
22 > + if python_check_deps; then
23 > + einfo " python_check_deps succeeded"
24 > + else
25 > + einfo " python_check_deps failed"
26 > + fi
27 > }
28
29 I was about to go about merging this as suggested, but this masks the
30 return value, and then things like this always succeed:
31
32 if _python_run_check_deps "${impl}"; then
33
34 >
35 > # @FUNCTION: python_has_version
36 > --
37 > 2.37.0
38 >
39 >
40
41 --
42 ionen

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies