From patchwork Fri Feb 1 10:02:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [meta-java, for, denzil] 1/4] openjdk: not use update-alternatives class Date: Fri, 01 Feb 2013 10:02:45 -0000 From: Ting Liu X-Patchwork-Id: 43805 Message-Id: <1359712968-22554-2-git-send-email-b28495@freescale.com> To: Cc: b29882@freescale.com From: Ting Liu Signed-off-by: Ting Liu --- 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" -