Dnia 7 grudnia 2015 06:37:50 CET, Jason Zaman <[email protected]> napisał(a):
>On Sat, Nov 28, 2015 at 10:14:39PM +0100, Ulrich Mueller wrote:
>> Questions:
>> 1. Will these three functions be sufficient, or have we overlooked
>>    anything important?
>
>Can we also have get_version_component_count() in there?
>
>I have a package that likes to change the number of parts so I need to
>know how many parts before I can split it up.
>
>Basically this:
>if [[ $(get_version_component_count) -eq 6 ]]; then
>       STUDIO_V=$(get_version_component_range 1-4)
>       BUILD_V=$(get_version_component_range 5-6)
>else
>       STUDIO_V=$(get_version_component_range 1-3)
>       BUILD_V=$(get_version_component_range 4-5)
>fi

local v=( ${PV//./} )

then ${#v[@]}. With some more work, you should be even able to use negative 
indexing there to avoid conditionals.

I'd rather avoid introducing extra redundant functions for corner cases.

>
>-- Jason

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Reply via email to