diff options
author | Britney Fransen <brfransen@gmail.com> | 2014-12-18 22:10:03 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2014-12-18 22:10:03 (GMT) |
commit | cc2b78d94e871828520e3d291d95c1ebe61431e5 (patch) | |
tree | 2608b4dbce10931079e12133355593e1c3f9091b /abs/extra/java7-openjdk/jdk7-openjdk.install | |
parent | 78ed666d75c7b9b0523d9b0a67ceba935e82cef3 (diff) | |
download | linhes_pkgbuild-cc2b78d94e871828520e3d291d95c1ebe61431e5.zip linhes_pkgbuild-cc2b78d94e871828520e3d291d95c1ebe61431e5.tar.gz linhes_pkgbuild-cc2b78d94e871828520e3d291d95c1ebe61431e5.tar.bz2 |
java7-openjdk: update to 7.u71_2.5.3
Diffstat (limited to 'abs/extra/java7-openjdk/jdk7-openjdk.install')
-rw-r--r-- | abs/extra/java7-openjdk/jdk7-openjdk.install | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/abs/extra/java7-openjdk/jdk7-openjdk.install b/abs/extra/java7-openjdk/jdk7-openjdk.install new file mode 100644 index 0000000..92b440e --- /dev/null +++ b/abs/extra/java7-openjdk/jdk7-openjdk.install @@ -0,0 +1,50 @@ +THIS_JDK='java-7-openjdk' + +fix_default() { + if [ ! -x /usr/bin/java ]; then + /usr/bin/archlinux-java unset + echo "" + else + /usr/bin/archlinux-java get + fi +} + +post_install() { + default=$(fix_default) + case ${default} in + "" | ${THIS_JDK}/jre) + /usr/bin/archlinux-java set ${THIS_JDK} + ;; + ${THIS_JDK}) + # Nothing + ;; + *) + echo "Default Java environment is already set to '${default}'" + echo "See 'archlinux-java help' to change it" + ;; + esac + + if [ ! -f /etc/ssl/certs/java/cacerts ]; then + /usr/bin/update-ca-trust + fi +} + +post_upgrade() { + default=$(fix_default) + if [ -z "${default}" -o "x${default}" = "x${THIS_JDK}/jre" ]; then + /usr/bin/archlinux-java set ${THIS_JDK} + fi + + if [ ! -f /etc/ssl/certs/java/cacerts ]; then + /usr/bin/update-ca-trust + fi +} + +pre_remove() { + if [ "x$(fix_default)" = "x${THIS_JDK}" ]; then + sudo /usr/bin/archlinux-java unset + if [ -x /usr/lib/jvm/${THIS_JDK}/jre/bin/java ]; then + sudo /usr/bin/archlinux-java set ${THIS_JDK}/jre + fi + fi +} |