Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o, Ulrich Mueller <ulm@g.o>
Subject: Re: [gentoo-dev] [PATCH] eutils.eclass: In EAPI conditionals, replace "has" by case statements.
Date: Mon, 30 Nov 2015 09:49:39
Message-Id: 238B92C4-6111-485A-A2C5-117E6EDD3A1C@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH] eutils.eclass: In EAPI conditionals, replace "has" by case statements. by Ulrich Mueller
1 ,
2
3 Dnia 30 listopada 2015 07:52:59 CET, Ulrich Mueller <ulm@g.o> napisał(a):
4 >>>>>> On Mon, 30 Nov 2015, Davide Pesavento wrote:
5 >
6 >>> The patch below replaces them by case statements. (Unfortunately we
7 >>> cannot use fall-through (&;) because it is a bash 4 feature.)
8 >
9 >> Sounds reasonable, although I'd find an 'if' clause slightly more
10 >> readable, since there wouldn't be an 'else' branch in 2 out of 3
11 >> cases.
12 >
13 >It is slightly more complicated to match multiple patterns with [[ ]]
14 >because it requires multiple conditions, regexps, or extglob. We could
15 >of course use a bracket expression like [[ ${EAPI:-0} = [012345] ]]
16 >but I find it ugly in this context (and it won't be able to check for
17 >EAPI 10 ;) ).
18
19 Do you expect those functions to be restored in the eclass in EAPI 10? As I see it, it's moot argument.
20
21 >
22 >Besides, case seems to be the command most used for EAPI checking in
23 >eclasses.
24
25 Because usually it has three branches, not one or two.
26
27 >
28 >Ulrich
29
30 --
31 Sent from my Android device with K-9 Mail. Please excuse my brevity.