1 |
Alexis Ballier posted on Thu, 17 Sep 2015 18:36:06 +0200 as excerpted: |
2 |
|
3 |
> if [ "${PV#9999}" != "${PV}" ] ; then |
4 |
> SCM="git-r3" |
5 |
> fi |
6 |
|
7 |
[and elsewhere] |
8 |
|
9 |
I've seen this asked in other eclass review contexts, but not for |
10 |
awhile... |
11 |
|
12 |
Since gentoo requires bash, why are you using old borne shell |
13 |
compatibility test logic? Why not use [[ ]] tests and avoid the need for |
14 |
the "", since bash then can treat variables as a unit and quotes are only |
15 |
needed if the tested strings include variable-external space (thus |
16 |
avoiding quote-logic errors if you accidentally forget the quotes)? |
17 |
|
18 |
(I used to use the compatibility single-[ variant myself, since the |
19 |
working code I originally learned bash with was explicitly borne- |
20 |
compatible sysv-init init-scripts. But once I began to appreciate the |
21 |
power of the double-[[ version, I soon vastly preferred it, except of |
22 |
course where compatibility is necessary, and it explicitly is not here, |
23 |
since gentoo and PMS explicitly specify bash.) |
24 |
|
25 |
-- |
26 |
Duncan - List replies preferred. No HTML msgs. |
27 |
"Every nonfree program has a lord, a master -- |
28 |
and if you use the program, he is your master." Richard Stallman |