On Thu, 17 Sep 2015 23:17:11 +0000 (UTC)
Duncan <[email protected]> wrote:
> Alexis Ballier posted on Thu, 17 Sep 2015 18:36:06 +0200 as excerpted:
>
> > if [ "${PV#9999}" != "${PV}" ] ; then
> > SCM="git-r3"
> > fi
>
> [and elsewhere]
>
> I've seen this asked in other eclass review contexts, but not for
> awhile...
>
> Since gentoo requires bash, why are you using old borne shell
> compatibility test logic? Why not use [[ ]] tests and avoid the need
> for the "", since bash then can treat variables as a unit and quotes
> are only needed if the tested strings include variable-external space
> (thus avoiding quote-logic errors if you accidentally forget the
> quotes)?
>
just a matter of taste I'd say: I'm used to write portable shell code
since, as you say, sometimes bash is not necessarily there, or worse: in
some worlds, gpl3, hence bash, is just banned.
because of this, I'm more used to the [ "" ] constructs and hence find
it prettier :) highly subjective though.
also, you can see the quotes around ${PV} aren't useful in that
context either, which is again just a matter of what my eyes are used to
see :)
Alexis.
[...]