diff options
author | Daniel Bermond | 2018-12-12 12:47:43 +0000 |
---|---|---|
committer | Daniel Bermond | 2018-12-12 12:47:43 +0000 |
commit | b193d6ab5242146c6fd6137aaa8ac5e22541587b (patch) | |
tree | c906b330a6a41c38434129e2a2059c4a5ddb470d /jre.install | |
parent | cacbedfd08e429e1d9a3577cd5dbf07ff8d65cb6 (diff) | |
download | aur-b193d6ab5242146c6fd6137aaa8ac5e22541587b.tar.gz |
Updated to version 11.0.1
Diffstat (limited to 'jre.install')
-rw-r--r-- | jre.install | 105 |
1 files changed, 41 insertions, 64 deletions
diff --git a/jre.install b/jre.install index 25f98a8d2a24..512d7a1df4fc 100644 --- a/jre.install +++ b/jre.install @@ -1,74 +1,51 @@ -VERSION='<version>' -THIS_JAVA='java-${VERSION}-jre/jre' -NAME='JRE' - -all_off="$(tput sgr0)" -bold="${all_off}$(tput bold)" -blue="${bold}$(tput setaf 4)" -yellow="${bold}$(tput setaf 3)" - -note() { - printf "${blue}::${yellow} archlinux-java:${bold} $1${all_off}\n" -} - -note2() { - printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n" +THIS_JRE='java-11-jdk' + +fix_default() { + if [ ! -x /usr/bin/java ]; then + /usr/bin/archlinux-java unset + echo "" + else + /usr/bin/archlinux-java get + fi } post_install() { - default=$(archlinux-java get) - case ${default} in - "") - archlinux-java set ${THIS_JAVA} - note "${NAME} ('${THIS_JAVA}') set as default Java environment." - ;; - ${THIS_JAVA}) - note "${NAME} ('${THIS_JAVA}') set as default Java environment." - ;; - *) - note "Default Java environment already set to '${default}'. - To use ${NAME} ('${THIS_JAVA}'), run: - # archlinux-java set ${THIS_JAVA} - For status, use: - $ archlinux-java status" - ;; - esac - - if [[ ! -f /etc/ssl/certs/java/cacerts ]]; then - update-ca-trust - fi - - note2 "Since Oracle Java 9, some Qt 5 applications (such as the reader apps Zeal and - GoldenDict) will crash due to the existance of the Java NPAPI plugin symlink - (/usr/lib/mozilla/plugins/libnpjp2-jre${VERSION}.so). - - See: - - https://github.com/zealdocs/zeal/issues/802 - - https://bbs.archlinux.org/viewtopic.php?id=231222" + default=$(fix_default) + case ${default} in + "") + /usr/bin/archlinux-java set ${THIS_JRE} + ;; + ${THIS_JRE}) + # Nothing + ;; + *) + echo "Default Java environment is already set to '${default}'" + echo "See 'archlinux-java help' to change it." + ;; + esac + + echo "When you use a non-reparenting window manager," + echo "set _JAVA_AWT_WM_NONREPARENTING=1 in /etc/profile.d/jre.sh" + + if [ ! -f /etc/ssl/certs/java/cacerts ]; then + /usr/bin/update-ca-trust + fi } post_upgrade() { - post_install -} + if [ -z "$(fix_default)" ]; then + /usr/bin/archlinux-java set ${THIS_JRE} + fi -pre_remove() { - default=$(archlinux-java get) - if [[ ${default} = ${THIS_JAVA} ]]; then - archlinux-java unset - fi + if [ ! -f /etc/ssl/certs/java/cacerts ]; then + /usr/bin/update-ca-trust + fi } -post_remove() { - default=$(archlinux-java get) # reassign - if [[ ${default} ]]; then - note "Default Java environment is '${default}'." - else - archlinux-java fix - default=$(archlinux-java get) # re-reassign - if [[ ${default} ]]; then - note "Default Java environment left as '${default}'." - else - note "Java environment unset." - fi - fi +pre_remove() { + default=$(fix_default) + if [ "x${default}" = "x${THIS_JRE}" ]; then + /usr/bin/archlinux-java unset + echo "No Java environment is set as default anymore" + fi } |