Gentoo Archives: gentoo-dev

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

Replies