diff options
author | Henning Heinold <heinold@inf.fu-berlin.de> | 2013-01-24 22:30:58 +0100 |
---|---|---|
committer | Henning Heinold <heinold@inf.fu-berlin.de> | 2013-01-25 09:06:52 +0100 |
commit | 904397bdae60423ee6d210f9aa65e57dc26ae155 (patch) | |
tree | aaa145694931d591e4bc0b338d7f243133e4aa1f /recipes-core/openjdk/openjdk-postinst.inc | |
parent | c737e1825b815203ef37b494279bda6736764ba5 (diff) | |
download | meta-java-904397bdae60423ee6d210f9aa65e57dc26ae155.tar.gz |
openjdk: factor out the postinst bits
* bump INC_PR of openjdk-6-common.inc
* when both are going to be installed use jdk-7 as default
Diffstat (limited to 'recipes-core/openjdk/openjdk-postinst.inc')
-rw-r--r-- | recipes-core/openjdk/openjdk-postinst.inc | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/recipes-core/openjdk/openjdk-postinst.inc b/recipes-core/openjdk/openjdk-postinst.inc new file mode 100644 index 0000000..e63a451 --- /dev/null +++ b/recipes-core/openjdk/openjdk-postinst.inc | |||
@@ -0,0 +1,85 @@ | |||
1 | # handles all postinst action for openjdk | ||
2 | |||
3 | pkg_postinst_${JDKPN}-vm-shark () { | ||
4 | if grep -q "\-server ERROR" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && ! grep -q "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
5 | sed -i -e "/\-shark.*/d" -e "s|\(^\-server*\)|\-shark KNOWN\n\1|" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
6 | else | ||
7 | sed -i -e "s/\-shark.*/\-shark KNOWN/" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
8 | fi | ||
9 | } | ||
10 | |||
11 | pkg_prerm_${JDKPN}-vm-shark () { | ||
12 | sed -i -e "/^\-shark.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
13 | if grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
14 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -1` | ||
15 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
16 | fi | ||
17 | |||
18 | echo "-shark ERROR" >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
19 | } | ||
20 | |||
21 | pkg_postinst_${JDKPN}-vm-cacao () { | ||
22 | if grep -q "\-server ERROR" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && ! grep -q "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
23 | sed -i -e "/\-cacao.*/d" -e "s|\(^\-server*\)|\-cacao KNOWN\n\1|" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
24 | else | ||
25 | sed -i -e "s/\-cacao.*/\-cacao KNOWN/" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
26 | fi | ||
27 | } | ||
28 | |||
29 | pkg_prerm_${JDKPN}-vm-cacao () { | ||
30 | sed -i -e "/^\-cacao.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
31 | if grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
32 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -1` | ||
33 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
34 | fi | ||
35 | |||
36 | echo "-cacao ERROR" >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
37 | } | ||
38 | |||
39 | pkg_postinst_${JDKPN}-vm-jamvm () { | ||
40 | if grep -q "\-server ERROR" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && ! grep -q "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
41 | sed -i -e "/\-jamvm.*/d" -e "s|\(^\-server*\)|\-jamvm KNOWN\n\1|" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
42 | else | ||
43 | sed -i -e "s/\-jamvm.*/\-jamvm KNOWN/" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
44 | fi | ||
45 | } | ||
46 | |||
47 | pkg_prerm_${JDKPN}-vm-jamvm () { | ||
48 | sed -i -e "/^\-jamvm.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
49 | if grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
50 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -1` | ||
51 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
52 | fi | ||
53 | |||
54 | echo "-jamvm ERROR" >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
55 | } | ||
56 | |||
57 | pkg_postinst_${JDKPN}-vm-zero () { | ||
58 | if grep -q "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && grep -q "\-server ERROR" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
59 | FIRST_KNOWN=`grep "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -1` | ||
60 | sed -i -e "/${FIRST_KNOWN}/d" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
61 | echo ${FIRST_KNOWN} >> $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
62 | fi | ||
63 | |||
64 | sed -i -e "s|^\-server.*|\-server KNOWN|" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
65 | } | ||
66 | |||
67 | pkg_prerm_${JDKPN}-vm-zero () { | ||
68 | sed -i -e "/^\-server.*/\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
69 | if grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
70 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -1` | ||
71 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
72 | fi | ||
73 | } | ||
74 | |||
75 | inherit update-alternatives | ||
76 | |||
77 | ALTERNATIVE_${JDKPN}-jre = "java" | ||
78 | ALTERNATIVE_TARGET_${JDKPN}-jre = "${JDK_HOME}/jre/bin/java" | ||
79 | |||
80 | ALTERNATIVE_${JDKPN}-jdk = "javac" | ||
81 | ALTERNATIVE_TARGET_${JDKPN}-jdk = "${JDK_HOME}/bin/javac" | ||
82 | |||
83 | ALTERNATIVE_LINK_NAME[java] = "${bindir}/java" | ||
84 | ALTERNATIVE_LINK_NAME[javac] = "${bindir}/javac" | ||
85 | |||