>>>>> On Mon, 7 Dec 2015, Jason Zaman wrote:

> 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

You could use a condition like:

    if [[ -n $(version_cut 6) ]]; then

This assumes that the function would simply return an empty string
when trying to read after the last component.

Ulrich

Attachment: pgpfZ4xb5ioFX.pgp
Description: PGP signature

Reply via email to