Justin Lecher (jlec) <j...@gentoo.org> wrote:
>>> [[ -n ${_INTEL_PV4} ]] && _INTEL_PV+="${_INTEL_PV4}-"
>>> [[ -n ${_INTEL_PV1} ]] && _INTEL_PV+="${_INTEL_PV1}"
>>> [[ -n ${_INTEL_PV2} ]] && _INTEL_PV+=".${_INTEL_PV2}"
>>> [[ -n ${_INTEL_PV3} ]] && _INTEL_PV+=".${_INTEL_PV3}"
>>> [[ -n ${_INTEL_PV4} ]] && _INTEL_PV+="-${_INTEL_PV4}"
>>
>> Now, this is crazy ;-). I don't see immediately how to improve that,
>> but I suggest you thought about that.
>
> [...] So there is no sanity other then reshuffling.

You could put the logic into the string:

_INTEL_PV+="${_INTEL_PV4}${_INTEL_PV4:+-}${_INTEL_PV1}"
_INTEL_PV+="${_INTEL_PV2:+.}${_INTEL_PV2}"
_INTEL_PV+="${_INTEL_PV3:+.}${_INTEL_PV3}"
_INTEL_PV+="${_INTEL_PV4:+-}${_INTEL_PV4}"


Reply via email to