public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] java-pkg-opt-2.eclass: fix java-pkg-opt-2_src_prepare to always call eapply_user for EAPI-6+
@ 2017-07-30 11:32 Andrew Savchenko
  2017-07-30 21:08 ` James Le Cuirot
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Savchenko @ 2017-07-30 11:32 UTC (permalink / raw)
  To: gentoo-dev; +Cc: java


[-- Attachment #1.1: Type: text/plain, Size: 1063 bytes --]

Hi all,

For EAPI 6+ java-pkg-opt-2_src_prepare() has eapply_user call via
java-utils-2_src_prepare() from java-utils-2.eclass. But
java-utils-2_src_prepare() call is conditional and in case when
package is build with USE=-java java-utils-2_src_prepare() is not
called, hence eapply_user is not called in src_prepare phase and
ebuild fails.

The following patch fixes this by calling eapply_user if java USE
is disabled _and_ EAPI is 6+.

[pedantic mode on]
Strictly speaking when EAPI is other than [0-5]. The way java-*
eclasses are now, they assume ![0-5] == 6+. It may be speculated
that this is not entirely correct and many other eclasses
explicitly deny all unknown EAPIs. If someone is interesting in
fixing this issue, please handle it with the java team and do not
mix it into the problem described at the beginning. My goal now is
to fix eapply_user issue which cases trouble for any EAPI 6
packages with optional java support and default src_prepare() at
the ebuild scope.
[pedantic mode off]

Best regards,
Andrew Savchenko

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: java-pkg-opt-2.eclass.patch --]
[-- Type: text/x-diff; name="java-pkg-opt-2.eclass.patch", Size: 540 bytes --]

diff --git a/eclass/java-pkg-opt-2.eclass b/eclass/java-pkg-opt-2.eclass
index 16c9f8f..c0b05f9 100644
--- a/eclass/java-pkg-opt-2.eclass
+++ b/eclass/java-pkg-opt-2.eclass
@@ -43,7 +43,11 @@ java-pkg-opt-2_pkg_setup() {
 # default src_prepare, wrapper for java-utils-2_src_prepare
 
 java-pkg-opt-2_src_prepare() {
-	use ${JAVA_PKG_OPT_USE} && java-utils-2_src_prepare
+	use ${JAVA_PKG_OPT_USE} && java-utils-2_src_prepare 
+	case "${EAPI:-0}" in
+		[0-5]) ;;
+		*) use ${JAVA_PKG_OPT_USE} || eapply_user ;;
+	esac
 }
 
 

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

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

* Re: [gentoo-dev] [PATCH] java-pkg-opt-2.eclass: fix java-pkg-opt-2_src_prepare to always call eapply_user for EAPI-6+
  2017-07-30 11:32 [gentoo-dev] [PATCH] java-pkg-opt-2.eclass: fix java-pkg-opt-2_src_prepare to always call eapply_user for EAPI-6+ Andrew Savchenko
@ 2017-07-30 21:08 ` James Le Cuirot
  2017-08-07 12:25   ` Andrew Savchenko
  0 siblings, 1 reply; 3+ messages in thread
From: James Le Cuirot @ 2017-07-30 21:08 UTC (permalink / raw)
  To: gentoo-dev

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

On Sun, 30 Jul 2017 14:32:53 +0300
Andrew Savchenko <bircoph@gentoo.org> wrote:

> For EAPI 6+ java-pkg-opt-2_src_prepare() has eapply_user call via
> java-utils-2_src_prepare() from java-utils-2.eclass. But
> java-utils-2_src_prepare() call is conditional and in case when
> package is build with USE=-java java-utils-2_src_prepare() is not
> called, hence eapply_user is not called in src_prepare phase and
> ebuild fails.
> 
> The following patch fixes this by calling eapply_user if java USE
> is disabled _and_ EAPI is 6+.

This makes sense so no problem here.

> [pedantic mode on]
> Strictly speaking when EAPI is other than [0-5]. The way java-*
> eclasses are now, they assume ![0-5] == 6+. It may be speculated
> that this is not entirely correct and many other eclasses
> explicitly deny all unknown EAPIs. If someone is interesting in
> fixing this issue, please handle it with the java team and do not
> mix it into the problem described at the beginning. My goal now is
> to fix eapply_user issue which cases trouble for any EAPI 6
> packages with optional java support and default src_prepare() at
> the ebuild scope.
> [pedantic mode off]

Agreed. I don't think java-utils-2_src_prepare() should be changed in
this regard as the behaviour may continue to be correct but the eclass
should have a global EAPI check that forbids anything beyond 6 like
other eclasses do.

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

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

* Re: [gentoo-dev] [PATCH] java-pkg-opt-2.eclass: fix java-pkg-opt-2_src_prepare to always call eapply_user for EAPI-6+
  2017-07-30 21:08 ` James Le Cuirot
@ 2017-08-07 12:25   ` Andrew Savchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Savchenko @ 2017-08-07 12:25 UTC (permalink / raw)
  To: gentoo-dev

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

On Sun, 30 Jul 2017 22:08:18 +0100 James Le Cuirot wrote:
> On Sun, 30 Jul 2017 14:32:53 +0300
> Andrew Savchenko <bircoph@gentoo.org> wrote:
> 
> > For EAPI 6+ java-pkg-opt-2_src_prepare() has eapply_user call via
> > java-utils-2_src_prepare() from java-utils-2.eclass. But
> > java-utils-2_src_prepare() call is conditional and in case when
> > package is build with USE=-java java-utils-2_src_prepare() is not
> > called, hence eapply_user is not called in src_prepare phase and
> > ebuild fails.
> > 
> > The following patch fixes this by calling eapply_user if java USE
> > is disabled _and_ EAPI is 6+.
> 
> This makes sense so no problem here.
> 
> > [pedantic mode on]
> > Strictly speaking when EAPI is other than [0-5]. The way java-*
> > eclasses are now, they assume ![0-5] == 6+. It may be speculated
> > that this is not entirely correct and many other eclasses
> > explicitly deny all unknown EAPIs. If someone is interesting in
> > fixing this issue, please handle it with the java team and do not
> > mix it into the problem described at the beginning. My goal now is
> > to fix eapply_user issue which cases trouble for any EAPI 6
> > packages with optional java support and default src_prepare() at
> > the ebuild scope.
> > [pedantic mode off]
> 
> Agreed. I don't think java-utils-2_src_prepare() should be changed in
> this regard as the behaviour may continue to be correct but the eclass
> should have a global EAPI check that forbids anything beyond 6 like
> other eclasses do.

Applied in the tree. The whitespace change from the original patch
is removed.

Best regards,
Andrew Savchenko

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

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

end of thread, other threads:[~2017-08-07 12:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-30 11:32 [gentoo-dev] [PATCH] java-pkg-opt-2.eclass: fix java-pkg-opt-2_src_prepare to always call eapply_user for EAPI-6+ Andrew Savchenko
2017-07-30 21:08 ` James Le Cuirot
2017-08-07 12:25   ` Andrew Savchenko

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