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