All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-java][PATCH 1/2] Revert "base-files: Define JAVA_HOME by default"
@ 2018-11-29 10:48 Fang Jia
  2018-11-29 10:48 ` [meta-java][PATCH 2/2] openjdk-common: Define JAVA_HOME by default Fang Jia
  0 siblings, 1 reply; 5+ messages in thread
From: Fang Jia @ 2018-11-29 10:48 UTC (permalink / raw)
  To: openembedded-devel

This reverts commit ada652564f09756a81f54495cbc2091125239625.

When enable multilib on 64bit system, probably both base-file and
lib32-base-files are installed.
Since both packages want to modify the file "profile", then there
will be an error like:
"
Error: Transaction check error:
file /etc/profile conflicts between attempted installs of
lib32-base-files-3.0.14-r148.gpb_virt and
base-files-3.0.14-r148.gpb_virt
"
The task should be added into openjdk pacakge as postinst script.

Signed-off-by: Fang Jia <fang.jia@windriver.com>
---
 recipes-core/base-files/base-files_3.0.14.bbappend | 13 -------------
 1 file changed, 13 deletions(-)
 delete mode 100644 recipes-core/base-files/base-files_3.0.14.bbappend

diff --git a/recipes-core/base-files/base-files_3.0.14.bbappend b/recipes-core/base-files/base-files_3.0.14.bbappend
deleted file mode 100644
index 4651185..0000000
--- a/recipes-core/base-files/base-files_3.0.14.bbappend
+++ /dev/null
@@ -1,13 +0,0 @@
-do_install_append() {
-	cat >> ${D}${sysconfdir}/profile << EOT
-JAVA_HOME=""
-for dir in ${libdir}/jvm/*; do
-	if [ -x "\${dir}/bin/java" ]; then
-		[ -z "\${JAVA_HOME}" ] && JAVA_HOME="\${dir}"
-	fi
-done
-if [ -n "\${JAVA_HOME}" ]; then
-	export JAVA_HOME=\${JAVA_HOME}
-fi
-EOT
-}
-- 
2.7.4



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

* [meta-java][PATCH 2/2] openjdk-common: Define JAVA_HOME by default
  2018-11-29 10:48 [meta-java][PATCH 1/2] Revert "base-files: Define JAVA_HOME by default" Fang Jia
@ 2018-11-29 10:48 ` Fang Jia
  2018-12-17 13:45   ` Richard Leitner
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Fang Jia @ 2018-11-29 10:48 UTC (permalink / raw)
  To: openembedded-devel

Use postinst script to set the JAVA_HOME by default.

Signed-off-by: Fang Jia <fang.jia@windriver.com>
---
 recipes-core/openjdk/openjdk-common.inc | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/recipes-core/openjdk/openjdk-common.inc b/recipes-core/openjdk/openjdk-common.inc
index 01a0a2a..aaf81f6 100644
--- a/recipes-core/openjdk/openjdk-common.inc
+++ b/recipes-core/openjdk/openjdk-common.inc
@@ -5,3 +5,17 @@ JDK_ARCH = "${@openjdk_build_helper_get_jdk_arch(d)}"
 
 # Provides the target architecture to the configure script.
 export LLVM_CONFIGURE_ARCH="${@openjdk_build_helper_get_llvm_configure_arch(d)}"
+
+pkg_postinst_${PN}() {
+	cat >> $D${sysconfdir}/profile << EOT
+JAVA_HOME=""
+for dir in ${libdir}/jvm/*; do
+        if [ -x "\${dir}/bin/java" ]; then
+                [ -z "\${JAVA_HOME}" ] && JAVA_HOME="\${dir}"
+        fi
+done
+if [ -n "\${JAVA_HOME}" ]; then
+        export JAVA_HOME=\${JAVA_HOME}
+fi
+EOT
+}
-- 
2.7.4



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

* Re: [meta-java][PATCH 2/2] openjdk-common: Define JAVA_HOME by default
  2018-11-29 10:48 ` [meta-java][PATCH 2/2] openjdk-common: Define JAVA_HOME by default Fang Jia
@ 2018-12-17 13:45   ` Richard Leitner
  2019-01-02 20:06   ` André Draszik
  2019-01-03  8:11   ` André Draszik
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Leitner @ 2018-12-17 13:45 UTC (permalink / raw)
  To: openembedded-devel, Fang Jia

Hi,
thanks for the patch!

Just one question: what happens when the package gets removed?
Is there any mechanism to remove the JAVA_HOME definition again?

If not: may you please implement one? Thanks!

regards;Richard.L

On 29.11.18 11:48, Fang Jia wrote:
> Use postinst script to set the JAVA_HOME by default.
> 
> Signed-off-by: Fang Jia <fang.jia@windriver.com>
> ---
>  recipes-core/openjdk/openjdk-common.inc | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/recipes-core/openjdk/openjdk-common.inc b/recipes-core/openjdk/openjdk-common.inc
> index 01a0a2a..aaf81f6 100644
> --- a/recipes-core/openjdk/openjdk-common.inc
> +++ b/recipes-core/openjdk/openjdk-common.inc
> @@ -5,3 +5,17 @@ JDK_ARCH = "${@openjdk_build_helper_get_jdk_arch(d)}"
>  
>  # Provides the target architecture to the configure script.
>  export LLVM_CONFIGURE_ARCH="${@openjdk_build_helper_get_llvm_configure_arch(d)}"
> +
> +pkg_postinst_${PN}() {
> +	cat >> $D${sysconfdir}/profile << EOT
> +JAVA_HOME=""
> +for dir in ${libdir}/jvm/*; do
> +        if [ -x "\${dir}/bin/java" ]; then
> +                [ -z "\${JAVA_HOME}" ] && JAVA_HOME="\${dir}"
> +        fi
> +done
> +if [ -n "\${JAVA_HOME}" ]; then
> +        export JAVA_HOME=\${JAVA_HOME}
> +fi
> +EOT
> +}
> 


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

* Re: [meta-java][PATCH 2/2] openjdk-common: Define JAVA_HOME by default
  2018-11-29 10:48 ` [meta-java][PATCH 2/2] openjdk-common: Define JAVA_HOME by default Fang Jia
  2018-12-17 13:45   ` Richard Leitner
@ 2019-01-02 20:06   ` André Draszik
  2019-01-03  8:11   ` André Draszik
  2 siblings, 0 replies; 5+ messages in thread
From: André Draszik @ 2019-01-02 20:06 UTC (permalink / raw)
  To: openembedded-devel

On Thu, 2018-11-29 at 18:48 +0800, Fang Jia wrote:
> Use postinst script to set the JAVA_HOME by default.
> 
> Signed-off-by: Fang Jia <fang.jia@windriver.com>
> ---
>  recipes-core/openjdk/openjdk-common.inc | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/recipes-core/openjdk/openjdk-common.inc b/recipes-
> core/openjdk/openjdk-common.inc
> index 01a0a2a..aaf81f6 100644
> --- a/recipes-core/openjdk/openjdk-common.inc
> +++ b/recipes-core/openjdk/openjdk-common.inc
> @@ -5,3 +5,17 @@ JDK_ARCH = "${@openjdk_build_helper_get_jdk_arch(d)}"
>  
>  # Provides the target architecture to the configure script.
>  export LLVM_CONFIGURE_ARCH="${@openjdk_build_helper_get_llvm_configure_ar
> ch(d)}"
> +
> +pkg_postinst_${PN}() {
> +	cat >> $D${sysconfdir}/profile << EOT
> +JAVA_HOME=""
> +for dir in ${libdir}/jvm/*; do
> +        if [ -x "\${dir}/bin/java" ]; then
> +                [ -z "\${JAVA_HOME}" ] && JAVA_HOME="\${dir}"
> +        fi
> +done
> +if [ -n "\${JAVA_HOME}" ]; then
> +        export JAVA_HOME=\${JAVA_HOME}
> +fi
> +EOT
> +}

I'd say this should be done via adding a file to ${sysconfdir}/profile.d/
instead. Have a look at e.g. the DistCC recipe
 poky.git/meta/recipes-devtools/devel-config/distcc-config.bb


Cheers,
Andre'




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

* Re: [meta-java][PATCH 2/2] openjdk-common: Define JAVA_HOME by default
  2018-11-29 10:48 ` [meta-java][PATCH 2/2] openjdk-common: Define JAVA_HOME by default Fang Jia
  2018-12-17 13:45   ` Richard Leitner
  2019-01-02 20:06   ` André Draszik
@ 2019-01-03  8:11   ` André Draszik
  2 siblings, 0 replies; 5+ messages in thread
From: André Draszik @ 2019-01-03  8:11 UTC (permalink / raw)
  To: openembedded-devel

On Thu, 2018-11-29 at 18:48 +0800, Fang Jia wrote:
> Use postinst script to set the JAVA_HOME by default.
> 
> Signed-off-by: Fang Jia <fang.jia@windriver.com>
> ---
>  recipes-core/openjdk/openjdk-common.inc | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/recipes-core/openjdk/openjdk-common.inc b/recipes-
> core/openjdk/openjdk-common.inc
> index 01a0a2a..aaf81f6 100644
> --- a/recipes-core/openjdk/openjdk-common.inc
> +++ b/recipes-core/openjdk/openjdk-common.inc

What about all the other Java providers that could be installed in the
system instead? The original did take care of that, whereas this only does
the right thing now if OpenJDK-8 is installed...

Cheers,
Andre'




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

end of thread, other threads:[~2019-01-03  8:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-29 10:48 [meta-java][PATCH 1/2] Revert "base-files: Define JAVA_HOME by default" Fang Jia
2018-11-29 10:48 ` [meta-java][PATCH 2/2] openjdk-common: Define JAVA_HOME by default Fang Jia
2018-12-17 13:45   ` Richard Leitner
2019-01-02 20:06   ` André Draszik
2019-01-03  8:11   ` André Draszik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.