summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2018-01-01 11:31:41 +0000
committerJames Le Cuirot <chewi@gentoo.org>2018-10-24 22:06:51 +0100
commit2c9605edbaadf82554bdaf86cccaf54d2e12cb2b (patch)
tree8a80a7ce107ac39c6ec5ef944a59cf68cb467efa
parentsys-apps/openrc: 0.39.1 bump for bug #669500. (diff)
downloadgentoo-2c9605edbaadf82554bdaf86cccaf54d2e12cb2b.tar.gz
gentoo-2c9605edbaadf82554bdaf86cccaf54d2e12cb2b.tar.bz2
gentoo-2c9605edbaadf82554bdaf86cccaf54d2e12cb2b.zip
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 <chewi@gentoo.org>
-rw-r--r--eclass/java-vm-2.eclass34
1 files 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.