Gentoo Archives: gentoo-dev

From: "Marty E. Plummer" <hanetzer@×××××××××.com>
To: gentoo-dev@l.g.o
Cc: Ulrich Mueller <ulm@g.o>
Subject: Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7
Date: Thu, 24 May 2018 01:19:31
Message-Id: 20180524011847.bjtbshi7p5brwcgs@proprietary-killer
In Reply to: Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7 by "Marty E. Plummer"
1 On Tue, May 22, 2018 at 09:33:59PM -0500, Marty E. Plummer wrote:
2 > On Mon, May 21, 2018 at 05:13:18PM -0500, Marty E. Plummer wrote:
3 > > On Mon, May 21, 2018 at 04:47:03PM -0500, Marty E. Plummer wrote:
4 > > > On Tue, May 08, 2018 at 11:03:47AM +0200, Ulrich Mueller wrote:
5 > > > > You could inherit eapi7-ver instead of versionator, which would save
6 > > > > the conditional below.
7 > > > >
8 > > > I didn't realize that eapi7-ver now supports 0-6 instead of just 6. I
9 > > > will rework this and the other patch I sent in for that reason, then.
10 > > Here we go. The eapi != 7 conditional is needed as eapi7 is 'not
11 > > supported' by eapi7-ver because its contents are already there.
12 >
13 > Once more, with changes suggested by [Arfrever] in #gentoo-java.
14
15 Should be the final iteration; added comments explaining why eclasses
16 were inherited, again suggested by [Arfrever].
17
18 ---
19 eclass/java-utils-2.eclass | 11 ++++++++---
20 1 file changed, 8 insertions(+), 3 deletions(-)
21
22 diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
23 index 25e35c33dd2..0ecc5eb5a94 100644
24 --- a/eclass/java-utils-2.eclass
25 +++ b/eclass/java-utils-2.eclass
26 @@ -15,7 +15,12 @@
27 # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for packages
28 # that have optional Java support. In addition you can inherit java-ant-2 for
29 # Ant-based packages.
30 -inherit eutils versionator multilib
31 +
32 +# Inherit multlib.eclass for get_libdir()
33 +[[ ${EAPI:-0} == [012345] ]] && inherit multilib
34 +# Inherit eapi7-ver.eclass for ver_cut()
35 +# Inherit eutils for eqawarn()
36 +[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver eutils
37
38 IUSE="elibc_FreeBSD"
39
40 @@ -1526,8 +1531,8 @@ java-pkg_is-vm-version-eq() {
41
42 local vm_version="$(java-pkg_get-vm-version)"
43
44 - vm_version="$(get_version_component_range 1-2 "${vm_version}")"
45 - needed_version="$(get_version_component_range 1-2 "${needed_version}")"
46 + vm_version="$(ver_cut 1-2 "${vm_version}")"
47 + needed_version="$(ver_cut 1-2 "${needed_version}")"
48
49 if [[ -z "${vm_version}" ]]; then
50 debug-print "Could not get JDK version from DEPEND"
51 --
52 2.17.0

Replies

Subject Author
Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7 "Marty E. Plummer" <hanetzer@×××××××××.com>