public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/eselect-java:master commit in: /, src/modules/
@ 2016-01-01  0:03 James Le Cuirot
  0 siblings, 0 replies; 4+ messages in thread
From: James Le Cuirot @ 2016-01-01  0:03 UTC (permalink / raw
  To: gentoo-commits

commit:     b7f70e8d9c2d58095fc75a275ad1922c26320f76
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 30 20:24:52 2015 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Thu Dec 31 23:55:57 2015 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=b7f70e8d

Remove the java-nsplugin eselect module

There was never much need for installing more than one Java plugin and
there is even less need now that Java plugins are all but outlawed.

The need for 32-bit browser plugins on 64-bit systems has also long
passed. A 64-bit IcedTea-Web plugin can launch a 32-bit VM anyway.

I had hoped that Firefox would allow you to disable individual Java
plugins but it disables them together and always picks Oracle's over
IcedTea's. We will simply have icedtea-web[nsplugin] soft block
oracle-(jdk|jre)-bin[nsplugin] instead.

 Makefile.am                          |   2 -
 README                               |   1 -
 src/modules/java-nsplugin.eselect.in | 216 -----------------------------------
 3 files changed, 219 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index f44bd80..30373cf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,13 +8,11 @@ modulesdir=$(datadir)/eselect/modules/
 
 modules_DATA = \
 	src/modules/ecj.eselect \
-	src/modules/java-nsplugin.eselect \
 	src/modules/java-vm.eselect \
 	src/modules/maven.eselect
 
 EXTRA_DIST += \
 	src/modules/ecj.eselect.in \
-	src/modules/java-nsplugin.eselect.in \
 	src/modules/java-vm.eselect.in \
 	src/modules/maven.eselect.in
 

diff --git a/README b/README
index f3d9a51..2943d68 100644
--- a/README
+++ b/README
@@ -8,7 +8,6 @@ Modules
 -------
 
 java-vm       : Manage system respectively user vm.
-java-nsplugin : Manage the nsplugin implementations.
 maven         : Manage the maven implementations.
 ecj           : Manage the ecj implementations.
 

diff --git a/src/modules/java-nsplugin.eselect.in b/src/modules/java-nsplugin.eselect.in
deleted file mode 100644
index 554a0bd..0000000
--- a/src/modules/java-nsplugin.eselect.in
+++ /dev/null
@@ -1,216 +0,0 @@
-# -*-eselect-*-  vim: ft=eselect
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-inherit tests multilib
-
-DESCRIPTION="Manage the Java plugin for Netscape-like Browsers"
-MAINTAINER="java@gentoo.org"
-VERSION="@VERSION@"
-
-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)
-    if has lib32 ${libdirs} && has lib64 ${libdirs}; then
-        return 0
-    else
-        return 1
-    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
-		local vm=$(plugin_to_vm ${plugin})
-		case ${MULTILIB_MODE} in
-			32)
-				[[ ${vm} = emul-linux-* ]] && echo ${vm}
-				;;
-			64)
-				if [[ ${vm} == icedtea-web ]]; then
-					get_icedtea_web_targets
-				elif [[ ${vm} != emul-linux-* ]]; then
-					echo ${vm}
-				fi
-				;;
-			none)
-				if [[ ${vm} == icedtea-web ]]; then
-					get_icedtea_web_targets
-				else
-					echo ${vm}
-				fi
-				;;
-		esac
-	done
-}
-
-plugin_to_vm() {
-	local base=$(basename ${1})
-	echo ${base%-javaplugin.so}
-}
-
-get_system_plugin_vm() {
-	local plugin;
-	
-	if [[ ${MULTILIB_MODE} == "32" ]]; then
-		plugin=$(readlink ${SYSTEM_PLUGIN_32})
-	elif [[ ${MULTILIB_MODE} == "64" ]]; then
-		plugin=$(readlink ${SYSTEM_PLUGIN_64})
-	else
-		plugin=$(readlink ${SYSTEM_PLUGIN})
-	fi
-	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 ###
-
-describe_show() {
-	echo "Show the current Java browser plugin"
-}
-
-do_show() {
-	local system_name=$(get_system_plugin_vm)
-	write_list_start "Current Java browser plugin"
-	if [[ -z "${system_name}" ]] ; then
-	    write_kv_list_entry "(unset)" ""
-	else
-	    write_kv_list_entry "${system_name}" ""
-	fi
-}
-
-### list action ###
-
-describe_list() {
-	echo "List available Java browser plugins"
-}
-
-tweak_list_item() {
-	local vm=${1}
-	local system_name=${2}
-	local mark=""
-	if [[ ${vm} == ${system_name} ]]; then
-		mark="${mark} $(highlight 'current')"
-	fi
-	echo "${vm} ${mark}"
-}
-
-do_list() {
-	if ! is_multilib; then
-		MULTILIB_MODE="none"
-		local system_name=$(get_system_plugin_vm)
-		local targets=( $(get_targets) )
-		for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do
-			targets[${i}]=$(tweak_list_item ${targets[${i}]} ${system_name})
-		done
-
-		write_list_start "Available Java browser plugins"
-		write_numbered_list "${targets[@]}"
-	else
-		MULTILIB_MODE="32"
-		local system_name_32=$(get_system_plugin_vm)
-		local targets_32=( $(get_targets) )
-		for (( i = 0 ; i < ${#targets_32[@]} ; i = i + 1 )) ; do
-			targets_32[${i}]=$(tweak_list_item ${targets_32[${i}]} ${system_name_32})
-		done
-		write_list_start "Available 32-bit Java browser plugins"
-		write_numbered_list "${targets_32[@]}" 
-
-		MULTILIB_MODE="64"
-		local system_name_64=$(get_system_plugin_vm)
-		local targets_64=( $(get_targets) )
-		for (( i = 0 ; i < ${#targets_64[@]} ; i = i + 1 )) ; do
-			targets_64[${i}]=$(tweak_list_item ${targets_64[${i}]} ${system_name_64})
-		done
-		write_list_start "Available 64-bit Java browser plugins"
-		write_numbered_list "${targets_64[@]}"
-	fi
-}
-
-### set action ###
-
-describe_set() {
-	echo "Set the system Java browser plugin"
-}
-
-do_set() {
-	if ! is_multilib; then
-		if [[ ${#} != 1 ]] ; then
-			die -q "Usage: set [nsplugin-vm]"
-		fi
-		MULTILIB_MODE="none"
-	else
-		if [[ ${#} != 2 ]] ; then
-			die -q "Usage: set [32bit or 64bit] [nsplugin-vm]"
-		fi
-		case ${1} in
-			32bit) ;;
-			64bit) ;;
-			*)
-				die -q "Usage: set [32bit or 64bit] [nsplugin-vm]"
-				;;
-		esac
-		MULTILIB_MODE=${1%bit}
-		shift
-	fi
-	
-	local vm=${1}
-
-	if is_number "${vm}" ; then
-		local targets=( $(get_targets) )
-		vm=${targets[$(( ${vm} - 1 ))]}
-	fi
-
-	if [[ -z ${vm} ]] ; then
-		die -q "You didn't specify valid plugin number to set"
-	fi
-	
-	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."
-		write_error_msg "Perhaps \"${vm}\" isn't a valid name of VM built with nsplugin?"
-		return
-	fi
-	
-	local system_plugin
-	case ${MULTILIB_MODE} in
-		32) system_plugin=${SYSTEM_PLUGIN_32} ;;
-		64) system_plugin=${SYSTEM_PLUGIN_64} ;;
-		none) system_plugin=${SYSTEM_PLUGIN} ;;
-	esac
-	mkdir -p $(dirname ${system_plugin}) || die -q "Error creating \"$(dirname ${SYSTEM_PLUGIN})\""
-	if [[ -w $(dirname ${system_plugin}) ]] ; then
-		ln -sf ${plugin} ${system_plugin} || die -q "Error creating nsplugin symlink"
-	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
-}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/eselect-java:master commit in: /, src/modules/
@ 2018-01-03 22:51 James Le Cuirot
  0 siblings, 0 replies; 4+ messages in thread
From: James Le Cuirot @ 2018-01-03 22:51 UTC (permalink / raw
  To: gentoo-commits

commit:     633fc2622b79f113ea9270f78954198fe7183ebd
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 28 21:46:43 2017 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Tue Jan  2 22:54:55 2018 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=633fc262

Sort java-vm targets in version order rather than alphanumeric

Java 10 may be around the corner.

 NEWS                           | 1 +
 src/modules/java-vm.eselect.in | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 3faaf11..a0102aa 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@
 
     * Don't emit (unset) or (not a symlink) on stderr (#549498)
     * Fix mkdir die message in java-vm module
+    * Sort java-vm targets in version order rather than alphanumeric
 
 0.3.0:
 

diff --git a/src/modules/java-vm.eselect.in b/src/modules/java-vm.eselect.in
index 3d5de4d..917b4d0 100644
--- a/src/modules/java-vm.eselect.in
+++ b/src/modules/java-vm.eselect.in
@@ -12,10 +12,13 @@ VM_USER="${HOME}/.gentoo${EPREFIX}/java-config-2/current-user-vm"
 VM_CONFIG="${EROOT}/usr/share/java-config-2/vm"
 
 find_targets() {
-	local f
-	for f in ${VM_BASE}/* ; do
-		[[ -L ${f} ]] && echo $(basename ${f})
+	local TARGETS=() target
+
+	for target in "${VM_BASE}"/*; do
+		[[ -L "${target}" ]] && TARGETS+=( ${target##*/} )
 	done
+
+	printf "%s\n" "${TARGETS[@]}" | sort -uV
 }
 
 sym_to_vm() {


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/eselect-java:master commit in: /, src/modules/
@ 2018-01-03 22:51 James Le Cuirot
  0 siblings, 0 replies; 4+ messages in thread
From: James Le Cuirot @ 2018-01-03 22:51 UTC (permalink / raw
  To: gentoo-commits

commit:     8c334ae2a91edbb44b2c7b9a472dfe3fc4d73276
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 30 22:53:25 2017 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Tue Jan  2 22:54:55 2018 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=8c334ae2

Add --if-unset option to java-vm's set action

 NEWS                           |  1 +
 src/modules/java-vm.eselect.in | 22 +++++++++++++++++-----
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index 8e0d519..6895cbc 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@
     * Sort java-vm targets in version order rather than alphanumeric
     * Fix showing and highlighting current ecj + mvn targets (#585224)
     * Fix insufficient quoting in java-vm module
+    * Add --if-unset option to java-vm's set action
 
 0.3.0:
 

diff --git a/src/modules/java-vm.eselect.in b/src/modules/java-vm.eselect.in
index b9043e6..b8654e3 100644
--- a/src/modules/java-vm.eselect.in
+++ b/src/modules/java-vm.eselect.in
@@ -103,20 +103,30 @@ describe_set() {
 	echo "Set a new system or user vm"
 }
 
+describe_set_options() {
+	echo "--if-unset : do not change if already set"
+}
+
 do_set() {
 	local usage="Usage [user|system] [vm]"
+	local ifunset=0
+
+	if [[ ${1} == "--if-unset" ]]; then
+		ifunset=1
+		shift
+	fi
+
 	if [[ ${#} != 2 ]]; then
 		die -q ${usage}
-		
 	elif [[ ${1} == "system" ]]; then
 		if [[ -w ${VM_SYSTEM%/*} ]]; then
-			my_set "${VM_SYSTEM}" "${2}"
+			my_set "${VM_SYSTEM}" "${2}" ${ifunset}
 		else
 			die -q "Sorry, you don't have enough permission to set system"
 		fi
 	elif [[ ${1} == "user" ]]; then
 		if [[ ${UID} != 0 ]]; then 
-			my_set "${VM_USER}" "${2}"
+			my_set "${VM_USER}" "${2}" ${ifunset}
 		else
 			die -q "Sorry, you cannot set a user vm as root. Set the system vm instead"
 		fi
@@ -126,12 +136,14 @@ do_set() {
 }
 
 my_set() {
-	local target=${2} symlink=${1}
+	local symlink=${1} target=${2} ifunset=${3}
 	if [[ -z ${target} ]] ; then
 		die -q "You didn't tell me what to set the symlink to"
 
 	elif [[ -L "${symlink}" ]] ; then
-		set_symlink "${target}" "${symlink}"  || die -q "Couldn't set a new symlink"
+		if [[ ${ifunset} == 0 || ! -d ${symlink} ]]; then
+			set_symlink "${target}" "${symlink}"  || die -q "Couldn't set a new symlink"
+		fi
 
 	elif [[ -e ${symlink} ]] ; then
 		die -q "Target file already exists and is not a symlink: ${symlink}"


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/eselect-java:master commit in: /, src/modules/
@ 2018-01-03 22:51 James Le Cuirot
  0 siblings, 0 replies; 4+ messages in thread
From: James Le Cuirot @ 2018-01-03 22:51 UTC (permalink / raw
  To: gentoo-commits

commit:     b3af201832a0781a907c02976056977e2cbd8219
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 30 21:09:25 2017 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Tue Jan  2 22:54:55 2018 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=b3af2018

Fix insufficient quoting in java-vm module

 NEWS                           |  1 +
 src/modules/java-vm.eselect.in | 24 ++++++++++++------------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/NEWS b/NEWS
index c85ba17..8e0d519 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@
     * Fix mkdir die message in java-vm module
     * Sort java-vm targets in version order rather than alphanumeric
     * Fix showing and highlighting current ecj + mvn targets (#585224)
+    * Fix insufficient quoting in java-vm module
 
 0.3.0:
 

diff --git a/src/modules/java-vm.eselect.in b/src/modules/java-vm.eselect.in
index 13da3f1..b9043e6 100644
--- a/src/modules/java-vm.eselect.in
+++ b/src/modules/java-vm.eselect.in
@@ -33,12 +33,12 @@ describe_show() {
 
 do_show() {
 	if [[ ${1} == "system" ]]; then
-		my_show ${VM_SYSTEM} 'system-vm'
+		my_show "${VM_SYSTEM}" 'system-vm'
 	elif [[ ${1} == "user" ]]; then
-		my_show ${VM_USER} 'user-vm'
+		my_show "${VM_USER}" 'user-vm'
 	else
-		my_show ${VM_SYSTEM} 'system-vm'
-		my_show ${VM_USER} 'user-vm'
+		my_show "${VM_SYSTEM}" 'system-vm'
+		my_show "${VM_USER}" 'user-vm'
 	fi
 }
 
@@ -65,11 +65,11 @@ do_list() {
 	if [[ -n ${targets[@]} ]] ; then
 		local i system_name user_name
 	
-		[[ -L ${VM_SYSTEM} ]] && system_name=$(sym_to_vm ${VM_SYSTEM})
-		[[ -L ${VM_USER} ]] && user_name=$(sym_to_vm ${VM_USER})
+		[[ -L ${VM_SYSTEM} ]] && system_name=$(sym_to_vm "${VM_SYSTEM}")
+		[[ -L ${VM_USER} ]] && user_name=$(sym_to_vm "${VM_USER}")
 
 		for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do
-			local build_only=$(grep 'BUILD_ONLY' ${VM_CONFIG}/${targets[${i}]} | cut -c 13-16 )
+			local build_only=$(grep 'BUILD_ONLY' "${VM_CONFIG}/${targets[${i}]}" | cut -c 13-16 )
 			local mark=""
 
 			if [[ "${build_only}" == "TRUE" || "{build_only}" == "true" ]]; then
@@ -109,14 +109,14 @@ do_set() {
 		die -q ${usage}
 		
 	elif [[ ${1} == "system" ]]; then
-		if [[ -w $(dirname ${VM_SYSTEM}) ]]; then
-			my_set ${VM_SYSTEM} ${2}
+		if [[ -w ${VM_SYSTEM%/*} ]]; then
+			my_set "${VM_SYSTEM}" "${2}"
 		else
 			die -q "Sorry, you don't have enough permission to set system"
 		fi
 	elif [[ ${1} == "user" ]]; then
 		if [[ ${UID} != 0 ]]; then 
-			my_set ${VM_USER} ${2}
+			my_set "${VM_USER}" "${2}"
 		else
 			die -q "Sorry, you cannot set a user vm as root. Set the system vm instead"
 		fi
@@ -133,7 +133,7 @@ my_set() {
 	elif [[ -L "${symlink}" ]] ; then
 		set_symlink "${target}" "${symlink}"  || die -q "Couldn't set a new symlink"
 
-	elif [[ -e "${symlink}" ]] ; then
+	elif [[ -e ${symlink} ]] ; then
 		die -q "Target file already exists and is not a symlink: ${symlink}"
 
 	else
@@ -149,7 +149,7 @@ set_symlink() {
 	fi
 	if [[ -z ${target} ]] ; then
 		die -q "Target \"${1}\" doesn't appear to be valid!"
-	elif [[ -d "${VM_BASE}/${target}" ]] ; then
+	elif [[ -d ${VM_BASE}/${target} ]] ; then
 		local sym_dir=${symlink%/*}
 		mkdir -p "${sym_dir}" || die -q "Could not create ${sym_dir}"
 		ln -snf "${VM_BASE}/${target}" "${symlink}"


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-03 22:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-03 22:51 [gentoo-commits] proj/eselect-java:master commit in: /, src/modules/ James Le Cuirot
  -- strict thread matches above, loose matches on Subject: below --
2018-01-03 22:51 James Le Cuirot
2018-01-03 22:51 James Le Cuirot
2016-01-01  0:03 James Le Cuirot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox