[oe] [meta-java][for denzil] 1/4] openjdk: not use update-alternatives class

b28495 at freescale.com b28495 at freescale.com
Fri Feb 1 10:02:45 UTC 2013


From: Ting Liu <b28495 at freescale.com>

Signed-off-by: Ting Liu <b28495 at freescale.com>
---
 recipes-core/openjdk/openjdk-6-common.inc |   19 +++++++++++++++++--
 recipes-core/openjdk/openjdk-7-common.inc |   19 +++++++++++++++++--
 recipes-core/openjdk/openjdk-postinst.inc |   11 -----------
 3 files changed, 34 insertions(+), 15 deletions(-)

diff --git a/recipes-core/openjdk/openjdk-6-common.inc b/recipes-core/openjdk/openjdk-6-common.inc
index 99f0aa9..5990de7 100644
--- a/recipes-core/openjdk/openjdk-6-common.inc
+++ b/recipes-core/openjdk/openjdk-6-common.inc
@@ -10,7 +10,7 @@ ICEDTEA = "icedtea6-${ICEDTEA_VERSION}"
 S = "${WORKDIR}/${ICEDTEA}"
 B = "${S}/build"
 
-INC_PR = "r21"
+INC_PR = "r22"
 
 SRC_URI = "\
   ${ICEDTEA_URI} \
@@ -461,4 +461,19 @@ FILES_${JDKPN}-doc = "${JDK_HOME}/man"
 
 require openjdk-postinst.inc
 
-ALTERNATIVE_PRIORITY = "20"
+pkg_postinst_${JDKPN}-jre () {
+    update-alternatives --install ${bindir}/java java ${JDK_HOME}/jre/bin/java 15
+}
+
+pkg_prerm_${JDKPN}-jre () {
+    update-alternatives --remove java ${JDK_HOME}/jre/bin/java
+}
+
+pkg_postinst_${JDKPN}-jdk () {
+    update-alternatives --install ${bindir}/javac javac ${JDK_HOME}/bin/javac 15
+}
+
+pkg_prerm_${JDKPN}-jdk () {
+    update-alternatives --remove javac ${JDK_HOME}/bin/javac
+}
+
diff --git a/recipes-core/openjdk/openjdk-7-common.inc b/recipes-core/openjdk/openjdk-7-common.inc
index 3246814..1dbfc0e 100644
--- a/recipes-core/openjdk/openjdk-7-common.inc
+++ b/recipes-core/openjdk/openjdk-7-common.inc
@@ -10,7 +10,7 @@ ICEDTEA = "NEEDS TO BE SET"
 S = "${WORKDIR}/${ICEDTEA}"
 B = "${S}/build"
 
-INC_PR = "r5"
+INC_PR = "r6"
 
 SRC_URI = " \
   ${ICEDTEA_URI} \
@@ -403,4 +403,19 @@ FILES_${JDKPN}-doc = "${JDK_HOME}/man"
 
 require openjdk-postinst.inc
 
-ALTERNATIVE_PRIORITY = "50"
+pkg_postinst_${JDKPN}-jre () {
+    update-alternatives --install ${bindir}/java java ${JDK_HOME}/jre/bin/java 15
+}
+
+pkg_prerm_${JDKPN}-jre () {
+    update-alternatives --remove java ${JDK_HOME}/jre/bin/java
+}
+
+pkg_postinst_${JDKPN}-jdk () {
+    update-alternatives --install ${bindir}/javac javac ${JDK_HOME}/bin/javac 15
+}
+
+pkg_prerm_${JDKPN}-jdk () {
+    update-alternatives --remove javac ${JDK_HOME}/bin/javac
+}
+
diff --git a/recipes-core/openjdk/openjdk-postinst.inc b/recipes-core/openjdk/openjdk-postinst.inc
index e63a451..3502b7a 100644
--- a/recipes-core/openjdk/openjdk-postinst.inc
+++ b/recipes-core/openjdk/openjdk-postinst.inc
@@ -72,14 +72,3 @@ pkg_prerm_${JDKPN}-vm-zero () {
         fi
 }
 
-inherit update-alternatives
-
-ALTERNATIVE_${JDKPN}-jre = "java"
-ALTERNATIVE_TARGET_${JDKPN}-jre = "${JDK_HOME}/jre/bin/java"
-
-ALTERNATIVE_${JDKPN}-jdk = "javac"
-ALTERNATIVE_TARGET_${JDKPN}-jdk = "${JDK_HOME}/bin/javac"
-
-ALTERNATIVE_LINK_NAME[java] = "${bindir}/java"
-ALTERNATIVE_LINK_NAME[javac] = "${bindir}/javac"
-
-- 
1.7.5.4






More information about the Openembedded-devel mailing list