1 |
On 09/18/2015 10:30 AM, Alexis Ballier wrote: |
2 |
> On Thu, 17 Sep 2015 23:17:11 +0000 (UTC) |
3 |
> Duncan <1i5t5.duncan@×××.net> wrote: |
4 |
> |
5 |
>> Alexis Ballier posted on Thu, 17 Sep 2015 18:36:06 +0200 as excerpted: |
6 |
>> |
7 |
>>> if [ "${PV#9999}" != "${PV}" ] ; then |
8 |
>>> SCM="git-r3" |
9 |
>>> fi |
10 |
>> |
11 |
>> [and elsewhere] |
12 |
>> |
13 |
>> I've seen this asked in other eclass review contexts, but not for |
14 |
>> awhile... |
15 |
>> |
16 |
>> Since gentoo requires bash, why are you using old borne shell |
17 |
>> compatibility test logic? Why not use [[ ]] tests and avoid the need |
18 |
>> for the "", since bash then can treat variables as a unit and quotes |
19 |
>> are only needed if the tested strings include variable-external space |
20 |
>> (thus avoiding quote-logic errors if you accidentally forget the |
21 |
>> quotes)? |
22 |
>> |
23 |
> |
24 |
> just a matter of taste I'd say: I'm used to write portable shell code |
25 |
> since, as you say, sometimes bash is not necessarily there, or worse: in |
26 |
> some worlds, gpl3, hence bash, is just banned. |
27 |
> |
28 |
> because of this, I'm more used to the [ "" ] constructs and hence find |
29 |
> it prettier :) highly subjective though. |
30 |
> |
31 |
> also, you can see the quotes around ${PV} aren't useful in that |
32 |
> context either, which is again just a matter of what my eyes are used to |
33 |
> see :) |
34 |
> |
35 |
> Alexis. |
36 |
> |
37 |
> [...] |
38 |
> |
39 |
|
40 |
eclasses (and ebuilds) are always bash in gentoo and I'd vote for |
41 |
writing "true" bash code, to stay consistent |