diff options
author | Joshua Nichols <nichoj@gentoo.org> | 2006-06-30 12:06:00 +0000 |
---|---|---|
committer | Joshua Nichols <nichoj@gentoo.org> | 2006-06-30 12:06:00 +0000 |
commit | 9d6a7f2187d5b2531813a01b5e739e7a916a1cf7 (patch) | |
tree | b08fa88cae4e9141736bc36138724d4615bc1b48 | |
parent | Updates and tweaks to run-java-tool. (diff) | |
download | java-config-9d6a7f2187d5b2531813a01b5e739e7a916a1cf7.tar.gz java-config-9d6a7f2187d5b2531813a01b5e739e7a916a1cf7.tar.bz2 java-config-9d6a7f2187d5b2531813a01b5e739e7a916a1cf7.zip |
Added java-nsplugin.eselect
svn path=/java-config-ng/branches/axxo/; revision=2404
-rw-r--r-- | setup.py | 6 | ||||
-rw-r--r-- | src/eselect/java-nsplugin.eselect | 76 |
2 files changed, 79 insertions, 3 deletions
@@ -6,7 +6,7 @@ from os import listdir setup ( name = 'java-config', - version = '2.0.22', + version = '2.0.26', description = 'java enviroment configuration tool', long_description = \ """ @@ -14,7 +14,7 @@ setup ( variables and configuration files involved in the java enviroment for Gentoo Linux. """, - maintainer = 'Gentoo Java Herd', + maintainer = 'Gentoo Java Team', maintainer_email = 'java@gentoo.org', url = 'http://www.gentoo.org', #packages = ['java_config'], @@ -24,7 +24,7 @@ setup ( ('share/java-config-2/pym/java_config/', ['src/java_config/'+file for file in listdir('src/java_config/')] ), ('share/man/man1', ['man/java-config-2.1']), ('share/java-config-2/launcher', ['src/launcher.bash']), - ('share/eselect/modules', ['src/eselect/java-vm.eselect']), + ('share/eselect/modules', ['src/eselect/java-vm.eselect','src/eselect/java-nsplugin.eselect']), ('/etc/java-config-2/', ['config/virtuals']), ('/etc/java-config-2/build/', ['config/jdk.conf','config/compilers.conf']), ('/etc/env.d/',['config/20java-config']), diff --git a/src/eselect/java-nsplugin.eselect b/src/eselect/java-nsplugin.eselect new file mode 100644 index 0000000..b9e6fa5 --- /dev/null +++ b/src/eselect/java-nsplugin.eselect @@ -0,0 +1,76 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: $ + +DESCRIPTION="Manage the Java plugin for Netscape-like Browsers" +MAINTAINER="java@gentoo.org" +SVN_DATE='$Date: $' +VERSION=$(svn_date_to_version "${SVN_DATE}" ) + +### list action + +PLUGINS_HOME="/usr/share/java-config-2/nsplugin" +SYSTEM_PLUGIN_DIR="/usr/lib/nsbrowser/plugins" +SYSTEM_PLUGIN="${SYSTEM_PLUGIN_DIR}/javaplugin.so" + +## {{{ list stuff + describe_list() { + echo "List available Java browser plugins" + } + + do_list() { + targets=( $(get_targets) ) + system_name=$(get_system_plugin_vm) + write_list_start "Available Java browser plugins" + + for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do + local vm=${targets[${i}]} + if [[ ${vm} == ${system_name} ]]; then + mark="${mark} $(highlight 'current')" + fi + targets[${i}]="${vm} ${mark}" + done + write_numbered_list "${targets[@]}" + } +## }}} + +### set action + +## {{{ set stuff + describe_set() { + echo "Set the system Java browser plugin" + } + + do_set() { + # TODO check for # of args + local vm=${1} + local plugin="${PLUGINS_HOME}/${vm}-javaplugin.so" + + if [[ ! -f ${plugin} ]]; then + write_error_msg "Expected to ${plugin} to exist, but it doesn't." + write_error_msg "Perhaps ${vm} isn't a valid plugin name?" + return + fi + + mkdir -p $(dirname ${SYSTEM_PLUGIN}) + ln -sf ${plugin} ${SYSTEM_PLUGIN} + } +## }}} +get_targets() { + for plugin in $(ls ${PLUGINS_HOME}/*-javaplugin.so); + do + echo $(plugin_to_vm ${plugin}) + done +} + +plugin_to_vm() { + local base=$(basename ${1}) + echo ${base%-javaplugin.so} +} + +get_system_plugin_vm() { + local plugin=$(readlink ${SYSTEM_PLUGIN}) + plugin_to_vm ${plugin} +} + +# vim: ts=4 sw=4 noet fdm=marker |