Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o, Jason Zaman <perfinion@g.o>
Subject: Re: [gentoo-dev] RFD: Replacement for versionator.eclass in PMS (for EAPI 7?)
Date: Mon, 07 Dec 2015 07:06:12
Message-Id: FA9FC2F9-A552-4CE5-98BA-3F2A83CC989D@gentoo.org
In Reply to: Re: [gentoo-dev] RFD: Replacement for versionator.eclass in PMS (for EAPI 7?) by Jason Zaman
1 Dnia 7 grudnia 2015 06:37:50 CET, Jason Zaman <perfinion@g.o> napisał(a):
2 >On Sat, Nov 28, 2015 at 10:14:39PM +0100, Ulrich Mueller wrote:
3 >> Questions:
4 >> 1. Will these three functions be sufficient, or have we overlooked
5 >> anything important?
6 >
7 >Can we also have get_version_component_count() in there?
8 >
9 >I have a package that likes to change the number of parts so I need to
10 >know how many parts before I can split it up.
11 >
12 >Basically this:
13 >if [[ $(get_version_component_count) -eq 6 ]]; then
14 > STUDIO_V=$(get_version_component_range 1-4)
15 > BUILD_V=$(get_version_component_range 5-6)
16 >else
17 > STUDIO_V=$(get_version_component_range 1-3)
18 > BUILD_V=$(get_version_component_range 4-5)
19 >fi
20
21 local v=( ${PV//./} )
22
23 then ${#v[@]}. With some more work, you should be even able to use negative indexing there to avoid conditionals.
24
25 I'd rather avoid introducing extra redundant functions for corner cases.
26
27 >
28 >-- Jason
29
30 --
31 Sent from my Android device with K-9 Mail. Please excuse my brevity.