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 |