Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] [PATCH v2] python-utils-r1.eclass: avoid nested ebegin calls
Date: Mon, 11 Jul 2022 17:22:04
Message-Id: CAJ0EP41h68zFu65u0=Hn5kTE8=hUL6axF2taqLJ7Db8mDFoT0Q@mail.gmail.com
In Reply to: Re: [gentoo-dev] [PATCH v2] python-utils-r1.eclass: avoid nested ebegin calls by Ionen Wolkens
1 On Mon, Jul 11, 2022 at 1:17 PM Ionen Wolkens <ionen@g.o> wrote:
2 >
3 > On Mon, Jul 11, 2022 at 01:08:52PM -0400, Mike Gilbert wrote:
4 > > On Mon, Jul 11, 2022 at 12:56 PM Ulrich Mueller <ulm@g.o> wrote:
5 > > >
6 > > > >>>>> On Mon, 11 Jul 2022, Ionen Wolkens wrote:
7 > > > >> - ebegin " python_check_deps"
8 > > > >> - python_check_deps
9 > > > >> - eend ${?}
10 > > > >> + einfo " python_check_deps"
11 > > > >> + if python_check_deps; then
12 > > > >> + einfo " python_check_deps succeeded"
13 > > > >> + else
14 > > > >> + einfo " python_check_deps failed"
15 > > > >> + fi
16 > > > >> }
17 > > >
18 > > > > I was about to go about merging this as suggested, but this masks the
19 > > > > return value, and then things like this always succeed:
20 > > >
21 > > > > if _python_run_check_deps "${impl}"; then
22 > > >
23 > > > Maybe leave ebegin/eend in place then, which was invented precisely for
24 > > > this use case? What's so bad about nesting it?
25 > >
26 > > It leads to odd looking output.
27 > >
28 > > https://gitweb.gentoo.org/proj/portage.git/commit/?id=eba088af8f335c0adb386461e6df1267e24800e7
29 > >
30 >
31 > Isn't that a portage problem? I don't think stopping legitimate use
32 > because portage displays messages weird is the right thing to do but
33 > should rather improve how portage displays them in this situation.
34
35 What is a "good" way to display it? I don't really think you can make
36 ebegin/eend look good when there are lines of output between them.