1 |
Justin Lecher (jlec) <jlec@g.o> wrote: |
2 |
>>> [[ -n ${_INTEL_PV4} ]] && _INTEL_PV+="${_INTEL_PV4}-" |
3 |
>>> [[ -n ${_INTEL_PV1} ]] && _INTEL_PV+="${_INTEL_PV1}" |
4 |
>>> [[ -n ${_INTEL_PV2} ]] && _INTEL_PV+=".${_INTEL_PV2}" |
5 |
>>> [[ -n ${_INTEL_PV3} ]] && _INTEL_PV+=".${_INTEL_PV3}" |
6 |
>>> [[ -n ${_INTEL_PV4} ]] && _INTEL_PV+="-${_INTEL_PV4}" |
7 |
>> |
8 |
>> Now, this is crazy ;-). I don't see immediately how to improve that, |
9 |
>> but I suggest you thought about that. |
10 |
> |
11 |
> [...] So there is no sanity other then reshuffling. |
12 |
|
13 |
You could put the logic into the string: |
14 |
|
15 |
_INTEL_PV+="${_INTEL_PV4}${_INTEL_PV4:+-}${_INTEL_PV1}" |
16 |
_INTEL_PV+="${_INTEL_PV2:+.}${_INTEL_PV2}" |
17 |
_INTEL_PV+="${_INTEL_PV3:+.}${_INTEL_PV3}" |
18 |
_INTEL_PV+="${_INTEL_PV4:+-}${_INTEL_PV4}" |