Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: Mart Raudsepp <leio@g.o>, David Seifert <soap@g.o>
Subject: Re: [gentoo-dev] [PATCH] wxwidgets.eclass: Support EAPI 8
Date: Sun, 01 Aug 2021 16:13:05
Message-Id: 5c5322e93bd204aa033d42a61eb48fb59d07639e.camel@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH] wxwidgets.eclass: Support EAPI 8 by Ulrich Mueller
1 On Sun, 2021-08-01 at 16:40 +0200, Ulrich Mueller wrote:
2 > > > > > > On Sun, 01 Aug 2021, Michał Górny wrote:
3 >
4 > > > + 3.0) [[ ${EAPI} == 7 ]] \
5 > > > + || die "GTK 2 no longer supported
6 > > > in EAPI ${EAPI}" ;;
7 >
8 > > Let's make it:
9 >
10 > >   [[ ${EAPI} != 7 ]] && die ...
11 >
12 > > to keep the logic more straightforward (and consistent with 'if ...;
13 > > then').
14 >
15 > Generally, I like the "<successful statement> || die" style more,
16 > because it is more common. It is also more consistent about the return
17 > status of the whole expression. With the && operator above, it would
18 > return shell false in case of success.
19
20 A user requested the other style in one of my earlier patches,
21 and I kinda agree that this reverse logic can easily get confusing.
22
23 > Of course, there's no functional difference here, but if you have it
24 > at
25 > the end of a function or before an explicit return statement it may
26 > play
27 > a role.
28
29 ...only if it's nonfatal-friendly.
30
31 --
32 Best regards,
33 Michał Górny