diff options
author | 2013-01-19 12:41:14 +0000 | |
---|---|---|
committer | 2013-01-19 12:41:14 +0000 | |
commit | f05897e1c955e46302b5f26074984d6b99579484 (patch) | |
tree | 76eef0af7b8b12de05321638dfaf0a349baaa885 | |
parent | Import run-java-tool and install location to pkglibexecdir instead of bindir (diff) | |
download | eselect-java-f05897e1c955e46302b5f26074984d6b99579484.tar.gz eselect-java-f05897e1c955e46302b5f26074984d6b99579484.tar.bz2 eselect-java-f05897e1c955e46302b5f26074984d6b99579484.zip |
Add support for icedtea-web with selectable jvm
svn path=/projects/eselect-java/trunk/; revision=9153
-rw-r--r-- | src/modules/java-nsplugin.eselect.in | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/src/modules/java-nsplugin.eselect.in b/src/modules/java-nsplugin.eselect.in index a2bbf2e..04cf413 100644 --- a/src/modules/java-nsplugin.eselect.in +++ b/src/modules/java-nsplugin.eselect.in @@ -12,6 +12,7 @@ PLUGINS_HOME="${EROOT}/usr/share/java-config-2/nsplugin" SYSTEM_PLUGIN="${EROOT}/usr/lib/nsbrowser/plugins/javaplugin.so" SYSTEM_PLUGIN_32="${EROOT}/usr/lib32/nsbrowser/plugins/javaplugin.so" SYSTEM_PLUGIN_64="${EROOT}/usr/lib64/nsbrowser/plugins/javaplugin.so" +ICEDTEA_WEB_VM="${EROOT}/etc/java-config-2/current-icedtea-web-vm" is_multilib() { local libdirs=$(list_libdirs) @@ -22,6 +23,13 @@ is_multilib() { fi } +get_icedtea_web_targets() { + local vm + for vm in $(echo /usr/lib/jvm/icedtea-*); do + echo "icedtea-web-$(basename ${vm})" + done +} + get_targets() { for plugin in $(ls ${PLUGINS_HOME}/*-javaplugin.so 2>/dev/null); do @@ -31,10 +39,18 @@ get_targets() { [[ ${vm} = emul-linux-* ]] && echo ${vm} ;; 64) - [[ ${vm} != emul-linux-* ]] && echo ${vm} + if [[ ${vm} == icedtea-web ]]; then + get_icedtea_web_targets + elif [[ ${vm} != emul-linux-* ]]; then + echo ${vm} + fi ;; none) - echo ${vm} + if [[ ${vm} == icedtea-web ]]; then + get_icedtea_web_targets + else + echo ${vm} + fi ;; esac done @@ -55,7 +71,14 @@ get_system_plugin_vm() { else plugin=$(readlink ${SYSTEM_PLUGIN}) fi - plugin_to_vm ${plugin} + plugin=$(basename ${plugin%-javaplugin.so}) + + if [[ ${plugin} == icedtea-web ]]; then + local icedtea=$(readlink "${ICEDTEA_WEB_VM}") + echo "${plugin}-$(basename ${icedtea})" + else + echo ${plugin} + fi } ### show action ### @@ -160,7 +183,12 @@ do_set() { die -q "You didn't specify valid plugin number to set" fi - local plugin="${PLUGINS_HOME}/${vm}-javaplugin.so" + local plugin + if [[ ${vm} == icedtea-web-* ]]; then + plugin="${PLUGINS_HOME}/icedtea-web-javaplugin.so" + else + plugin="${PLUGINS_HOME}/${vm}-javaplugin.so" + fi if [[ ! -f ${plugin} ]]; then write_error_msg "Expected \"${plugin}\" to exist, but it doesn't." @@ -180,4 +208,9 @@ do_set() { else die -q "Sorry, you don't have enough permission to set nsplugin" fi + + if [[ ${vm} == icedtea-web-* ]]; then + rm -f "${ICEDTEA_WEB_VM}" + ln -sf "${EROOT}"/usr/lib/jvm/${vm#icedtea-web-} "${ICEDTEA_WEB_VM}" + fi } |