Re: [gentoo-dev] [PATCH] eclass/java-utils-2: switch to eapi7-ver

2019-02-22 Thread Marty E. Plummer
On Thu, Feb 21, 2019 at 03:30:32PM +0100, Andreas Sturmlechner wrote:
> On Montag, 17. Dezember 2018 09:09:13 CET Marty E. Plummer wrote:
> > @@ -15,7 +15,7 @@
> >  # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for
> > packages # that have optional Java support. In addition you can inherit
> > java-ant-2 for # Ant-based packages.
> > -inherit eutils versionator multilib
> > +inherit eutils multilib
> 
> I would recommend to keep inheriting all those eclasses (including 
> versionator) for EAPI 0-6, in order not to break revdeps with implicit use. 
> Who knows in what shape they are, and no one is going to fix them for a long 
> time. But we don't want to inherit any of them with EAPI-7, hence merge it 
> with below hunk.
> 
Yeah, I came to the same conclusion when I suggested a move from
versionator to eapi7-ver for gnome.org.eclass and it had implicit deps
on versionator in its consumers.
> > @@ -25,6 +25,9 @@ export WANT_JAVA_CONFIG="2"
> >  # Prefix variables are only available for EAPI>=3
> >  has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}"
> > 
> > +# EAPI 7 has version functions built-in. Use eapi7-ver for all earlier 
> > eclasses.
> > +[[ ${EAPI} == [0123456] ]] && inherit eapi7-ver
> > +
> >  # @VARIABLE: JAVA_PKG_E_DEPEND
> >  # @INTERNAL
> >  # @DESCRIPTION:
> 
> 
> Regards,
> Andreas
> 
> 
> 



Re: [gentoo-dev] [PATCH] eclass/java-utils-2: switch to eapi7-ver

2019-02-21 Thread Andreas Sturmlechner
On Montag, 17. Dezember 2018 09:09:13 CET Marty E. Plummer wrote:
> @@ -15,7 +15,7 @@
>  # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for
> packages # that have optional Java support. In addition you can inherit
> java-ant-2 for # Ant-based packages.
> -inherit eutils versionator multilib
> +inherit eutils multilib

I would recommend to keep inheriting all those eclasses (including 
versionator) for EAPI 0-6, in order not to break revdeps with implicit use. 
Who knows in what shape they are, and no one is going to fix them for a long 
time. But we don't want to inherit any of them with EAPI-7, hence merge it 
with below hunk.

> @@ -25,6 +25,9 @@ export WANT_JAVA_CONFIG="2"
>  # Prefix variables are only available for EAPI>=3
>  has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}"
> 
> +# EAPI 7 has version functions built-in. Use eapi7-ver for all earlier 
> eclasses.
> +[[ ${EAPI} == [0123456] ]] && inherit eapi7-ver
> +
>  # @VARIABLE: JAVA_PKG_E_DEPEND
>  # @INTERNAL
>  # @DESCRIPTION:


Regards,
Andreas





[gentoo-dev] [PATCH] eclass/java-utils-2: switch to eapi7-ver

2018-12-17 Thread Marty E. Plummer
Signed-off-by: Marty E. Plummer 
---
 eclass/java-utils-2.eclass | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 473b177e539..a4c218c394e 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2018 Gentoo Foundation
+# Copyright 2004-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: java-utils-2.eclass
@@ -15,7 +15,7 @@
 # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for 
packages
 # that have optional Java support. In addition you can inherit java-ant-2 for
 # Ant-based packages.
-inherit eutils versionator multilib
+inherit eutils multilib
 
 IUSE="elibc_FreeBSD"
 
@@ -25,6 +25,9 @@ export WANT_JAVA_CONFIG="2"
 # Prefix variables are only available for EAPI>=3
 has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}"
 
+# EAPI 7 has version functions built-in. Use eapi7-ver for all earlier 
eclasses.
+[[ ${EAPI} == [0123456] ]] && inherit eapi7-ver
+
 # @VARIABLE: JAVA_PKG_E_DEPEND
 # @INTERNAL
 # @DESCRIPTION:
@@ -1518,8 +1521,8 @@ java-pkg_is-vm-version-eq() {
 
local vm_version="$(java-pkg_get-vm-version)"
 
-   vm_version="$(get_version_component_range 1-2 "${vm_version}")"
-   needed_version="$(get_version_component_range 1-2 "${needed_version}")"
+   vm_version="$(ver_cut 1-2 "${vm_version}")"
+   needed_version="$(ver_cut 1-2 "${needed_version}")"
 
if [[ -z "${vm_version}" ]]; then
debug-print "Could not get JDK version from DEPEND"
@@ -1570,7 +1573,7 @@ java-pkg_is-vm-version-ge() {
debug-print "Could not get JDK version from DEPEND"
return 1
else
-   if version_is_at_least "${needed_version}" "${vm_version}"; then
+   if ver_test "${vm_version}" -ge "${needed_version}"; then
debug-print "Detected a JDK(${vm_version}) >= 
${needed_version}"
return 0
else
-- 
2.20.0