public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7
@ 2018-05-08  6:22 Marty E. Plummer
  2018-05-08  9:03 ` Ulrich Mueller
  0 siblings, 1 reply; 7+ messages in thread
From: Marty E. Plummer @ 2018-05-08  6:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

---
 eclass/java-utils-2.eclass | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 25e35c33dd2..47bbb64ffd4 100644
--- a/eclass/java-utils-2.eclass
+++ b/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
+has "${EAPI:-0}" 0 1 2 3 4 5 6 && inherit eutils versionator multilib
 
 IUSE="elibc_FreeBSD"
 
@@ -1526,8 +1526,16 @@ 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}")"
+	case ${EAPI} in
+	0|1|2|3|4|5|6)
+		vm_version="$(get_version_component_range 1-2 "${vm_version}")"
+		needed_version="$(get_version_component_range 1-2 "${needed_version}")"
+		;;
+	7)
+		vm_version="$(ver_cut 1-2 "${vm_version}")"
+		needed_version="$(ver_cut 1-2 "${needed_version}")"
+		;;
+	esac
 
 	if [[ -z "${vm_version}" ]]; then
 		debug-print "Could not get JDK version from DEPEND"
-- 
2.17.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7
  2018-05-08  6:22 [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7 Marty E. Plummer
@ 2018-05-08  9:03 ` Ulrich Mueller
  2018-05-21 21:47   ` Marty E. Plummer
  0 siblings, 1 reply; 7+ messages in thread
From: Ulrich Mueller @ 2018-05-08  9:03 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

[-- Attachment #1: Type: text/plain, Size: 1471 bytes --]

>>>>> On Tue, 8 May 2018, Marty E Plummer wrote:

> ---
>  eclass/java-utils-2.eclass | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)

> diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
> index 25e35c33dd2..47bbb64ffd4 100644
> --- a/eclass/java-utils-2.eclass
> +++ b/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
> +has "${EAPI:-0}" 0 1 2 3 4 5 6 && inherit eutils versionator multilib
 
You could inherit eapi7-ver instead of versionator, which would save
the conditional below.

>  IUSE="elibc_FreeBSD"
 
> @@ -1526,8 +1526,16 @@ 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}")"
> +	case ${EAPI} in
> +	0|1|2|3|4|5|6)
> +		vm_version="$(get_version_component_range 1-2 "${vm_version}")"
> +		needed_version="$(get_version_component_range 1-2 "${needed_version}")"
> +		;;
> +	7)
> +		vm_version="$(ver_cut 1-2 "${vm_version}")"
> +		needed_version="$(ver_cut 1-2 "${needed_version}")"
> +		;;
> +	esac
 
>  	if [[ -z "${vm_version}" ]]; then
>  		debug-print "Could not get JDK version from DEPEND"
> -- 
> 2.17.0

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7
  2018-05-08  9:03 ` Ulrich Mueller
@ 2018-05-21 21:47   ` Marty E. Plummer
  2018-05-21 22:13     ` Marty E. Plummer
  0 siblings, 1 reply; 7+ messages in thread
From: Marty E. Plummer @ 2018-05-21 21:47 UTC (permalink / raw
  To: Ulrich Mueller; +Cc: gentoo-dev

On Tue, May 08, 2018 at 11:03:47AM +0200, Ulrich Mueller wrote:
> >>>>> On Tue, 8 May 2018, Marty E Plummer wrote:
> 
> > ---
> >  eclass/java-utils-2.eclass | 14 +++++++++++---
> >  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> > diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
> > index 25e35c33dd2..47bbb64ffd4 100644
> > --- a/eclass/java-utils-2.eclass
> > +++ b/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
> > +has "${EAPI:-0}" 0 1 2 3 4 5 6 && inherit eutils versionator multilib
>  
> You could inherit eapi7-ver instead of versionator, which would save
> the conditional below.
> 
I didn't realize that eapi7-ver now supports 0-6 instead of just 6. I
will rework this and the other patch I sent in for that reason, then.
> >  IUSE="elibc_FreeBSD"
>  
> > @@ -1526,8 +1526,16 @@ 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}")"
> > +	case ${EAPI} in
> > +	0|1|2|3|4|5|6)
> > +		vm_version="$(get_version_component_range 1-2 "${vm_version}")"
> > +		needed_version="$(get_version_component_range 1-2 "${needed_version}")"
> > +		;;
> > +	7)
> > +		vm_version="$(ver_cut 1-2 "${vm_version}")"
> > +		needed_version="$(ver_cut 1-2 "${needed_version}")"
> > +		;;
> > +	esac
>  
> >  	if [[ -z "${vm_version}" ]]; then
> >  		debug-print "Could not get JDK version from DEPEND"
> > -- 
> > 2.17.0




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7
  2018-05-21 21:47   ` Marty E. Plummer
@ 2018-05-21 22:13     ` Marty E. Plummer
  2018-05-23  2:33       ` Marty E. Plummer
  0 siblings, 1 reply; 7+ messages in thread
From: Marty E. Plummer @ 2018-05-21 22:13 UTC (permalink / raw
  To: Ulrich Mueller; +Cc: gentoo-dev

On Mon, May 21, 2018 at 04:47:03PM -0500, Marty E. Plummer wrote:
> On Tue, May 08, 2018 at 11:03:47AM +0200, Ulrich Mueller wrote:
> > You could inherit eapi7-ver instead of versionator, which would save
> > the conditional below.
> > 
> I didn't realize that eapi7-ver now supports 0-6 instead of just 6. I
> will rework this and the other patch I sent in for that reason, then.
Here we go. The eapi != 7 conditional is needed as eapi7 is 'not
supported' by eapi7-ver because its contents are already there.
---
 eclass/java-utils-2.eclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 25e35c33dd2..198d8b511f3 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -15,7 +15,8 @@
 # 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
+[[ ${EAPI} == 7 ]] || inherit eapi7-ver
 
 IUSE="elibc_FreeBSD"
 
@@ -1526,8 +1527,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"
-- 
2.17.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7
  2018-05-21 22:13     ` Marty E. Plummer
@ 2018-05-23  2:33       ` Marty E. Plummer
  2018-05-24  1:18         ` Marty E. Plummer
  0 siblings, 1 reply; 7+ messages in thread
From: Marty E. Plummer @ 2018-05-23  2:33 UTC (permalink / raw
  To: gentoo-dev; +Cc: Ulrich Mueller

On Mon, May 21, 2018 at 05:13:18PM -0500, Marty E. Plummer wrote:
> On Mon, May 21, 2018 at 04:47:03PM -0500, Marty E. Plummer wrote:
> > On Tue, May 08, 2018 at 11:03:47AM +0200, Ulrich Mueller wrote:
> > > You could inherit eapi7-ver instead of versionator, which would save
> > > the conditional below.
> > > 
> > I didn't realize that eapi7-ver now supports 0-6 instead of just 6. I
> > will rework this and the other patch I sent in for that reason, then.
> Here we go. The eapi != 7 conditional is needed as eapi7 is 'not
> supported' by eapi7-ver because its contents are already there.

Once more, with changes suggested by [Arfrever] in #gentoo-java.
---
 eclass/java-utils-2.eclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 25e35c33dd2..f45b29c9e32 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -15,7 +15,8 @@
 # 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
+[[ ${EAPI:-0} == [012345] ]] && inherit multilib
+[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver eutils
 
 IUSE="elibc_FreeBSD"
 
@@ -1526,8 +1527,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"
-- 
2.17.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7
  2018-05-23  2:33       ` Marty E. Plummer
@ 2018-05-24  1:18         ` Marty E. Plummer
  2018-06-04 21:30           ` Marty E. Plummer
  0 siblings, 1 reply; 7+ messages in thread
From: Marty E. Plummer @ 2018-05-24  1:18 UTC (permalink / raw
  To: gentoo-dev; +Cc: Ulrich Mueller

On Tue, May 22, 2018 at 09:33:59PM -0500, Marty E. Plummer wrote:
> On Mon, May 21, 2018 at 05:13:18PM -0500, Marty E. Plummer wrote:
> > On Mon, May 21, 2018 at 04:47:03PM -0500, Marty E. Plummer wrote:
> > > On Tue, May 08, 2018 at 11:03:47AM +0200, Ulrich Mueller wrote:
> > > > You could inherit eapi7-ver instead of versionator, which would save
> > > > the conditional below.
> > > > 
> > > I didn't realize that eapi7-ver now supports 0-6 instead of just 6. I
> > > will rework this and the other patch I sent in for that reason, then.
> > Here we go. The eapi != 7 conditional is needed as eapi7 is 'not
> > supported' by eapi7-ver because its contents are already there.
> 
> Once more, with changes suggested by [Arfrever] in #gentoo-java.

Should be the final iteration; added comments explaining why eclasses
were inherited, again suggested by [Arfrever].

---
 eclass/java-utils-2.eclass | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 25e35c33dd2..0ecc5eb5a94 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -15,7 +15,12 @@
 # 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 multlib.eclass for get_libdir()
+[[ ${EAPI:-0} == [012345] ]] && inherit multilib
+# Inherit eapi7-ver.eclass for ver_cut()
+# Inherit eutils for eqawarn()
+[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver eutils
 
 IUSE="elibc_FreeBSD"
 
@@ -1526,8 +1531,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"
-- 
2.17.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7
  2018-05-24  1:18         ` Marty E. Plummer
@ 2018-06-04 21:30           ` Marty E. Plummer
  0 siblings, 0 replies; 7+ messages in thread
From: Marty E. Plummer @ 2018-06-04 21:30 UTC (permalink / raw
  To: gentoo-dev

On Wed, May 23, 2018 at 08:18:48PM -0500, Marty E. Plummer wrote:
> 
> Should be the final iteration; added comments explaining why eclasses
> were inherited, again suggested by [Arfrever].
> 
Any thoughts?
> ---
>  eclass/java-utils-2.eclass | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
> index 25e35c33dd2..0ecc5eb5a94 100644
> --- a/eclass/java-utils-2.eclass
> +++ b/eclass/java-utils-2.eclass
> @@ -15,7 +15,12 @@
>  # 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 multlib.eclass for get_libdir()
> +[[ ${EAPI:-0} == [012345] ]] && inherit multilib
> +# Inherit eapi7-ver.eclass for ver_cut()
> +# Inherit eutils for eqawarn()
> +[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver eutils
>  
>  IUSE="elibc_FreeBSD"
>  
> @@ -1526,8 +1531,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"
> -- 
> 2.17.0
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-06-04 21:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-08  6:22 [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7 Marty E. Plummer
2018-05-08  9:03 ` Ulrich Mueller
2018-05-21 21:47   ` Marty E. Plummer
2018-05-21 22:13     ` Marty E. Plummer
2018-05-23  2:33       ` Marty E. Plummer
2018-05-24  1:18         ` Marty E. Plummer
2018-06-04 21:30           ` Marty E. Plummer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox