From 2c9605edbaadf82554bdaf86cccaf54d2e12cb2b Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Mon, 1 Jan 2018 11:31:41 +0000 Subject: java-vm-2.eclass: Replace java-config VM handling with eselect-java The VM handling options are deprecated. Closes: https://bugs.gentoo.org/368205 Signed-off-by: James Le Cuirot --- eclass/java-vm-2.eclass | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/eclass/java-vm-2.eclass b/eclass/java-vm-2.eclass index f6b50cfbd01a..2ce5bce0e71b 100644 --- a/eclass/java-vm-2.eclass +++ b/eclass/java-vm-2.eclass @@ -74,17 +74,9 @@ java-vm-2_pkg_setup() { # invalid. Also update mime database. java-vm-2_pkg_postinst() { - # Note that we cannot rely on java-config here, as it will silently recognize - # e.g. icedtea6-bin as valid system VM if icedtea6 is set but invalid (e.g. due - # to the migration to icedtea-6) - if [[ ! -L "${EROOT}${JAVA_VM_SYSTEM}" ]]; then - java_set_default_vm_ - else - local current_vm_path=$(readlink "${EROOT}${JAVA_VM_SYSTEM}") - local current_vm=$(basename "${ROOT}${current_vm_path}") - if [[ ! -L "${EROOT}${JAVA_VM_DIR}/${current_vm}" ]]; then - java_set_default_vm_ - fi + if [[ ! -d ${EROOT}${JAVA_VM_SYSTEM} ]]; then + eselect java-vm set system "${VMHANDLE}" + einfo "${P} set as the default system-vm." fi xdg_desktop_database_update @@ -98,10 +90,10 @@ java-vm-2_pkg_postinst() { # Warn user if removing system-vm. java-vm-2_pkg_prerm() { - if [[ "$(GENTOO_VM="" java-config -f 2>/dev/null)" == "${VMHANDLE}" && -z "${REPLACED_BY_VERSION}" ]]; then - ewarn "It appears you are removing your system-vm!" - ewarn "Please run java-config -L to list available VMs," - ewarn "then use java-config -S to set a new system-vm!" + if [[ $(GENTOO_VM= java-config -f 2>/dev/null) == ${VMHANDLE} && -z ${REPLACED_BY_VERSION} ]]; then + ewarn "It appears you are removing your system-vm! Please run" + ewarn "\"eselect java-vm list\" to list available VMs, then use" + ewarn "\"eselect java-vm set system\" to set a new system-vm!" fi } @@ -117,18 +109,6 @@ java-vm-2_pkg_postrm() { } -# @FUNCTION: java_set_default_vm_ -# @INTERNAL -# @DESCRIPTION: -# Set system-vm. - -java_set_default_vm_() { - java-config-2 --set-system-vm="${VMHANDLE}" - - einfo " ${P} set as the default system-vm." -} - - # @FUNCTION: get_system_arch # @DESCRIPTION: # Get Java specific arch name. -- cgit v1.2.3-65-gdbad