diff options
author | Mike Gilbert <floppym@gentoo.org> | 2024-04-19 14:26:28 -0400 |
---|---|---|
committer | Florian Schmaus <flow@gentoo.org> | 2024-04-20 13:28:28 +0200 |
commit | 0e67f002afa93cbea82e077931111acb1fddb3f4 (patch) | |
tree | 074a5d79e60c3b885987323ebe86aa4c75abbc92 | |
parent | Fix paramter description for "eselect java-vm set" (diff) | |
download | eselect-java-0e67f002afa93cbea82e077931111acb1fddb3f4.tar.gz eselect-java-0e67f002afa93cbea82e077931111acb1fddb3f4.tar.bz2 eselect-java-0e67f002afa93cbea82e077931111acb1fddb3f4.zip |
java-vm.eselect: fix symlink target when ROOT is not /
Bug: https://bugs.gentoo.org/793965
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: Florian Schmaus <flow@gentoo.org>
-rw-r--r-- | src/modules/java-vm.eselect.in | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/java-vm.eselect.in b/src/modules/java-vm.eselect.in index 8fac2a1..8181b8c 100644 --- a/src/modules/java-vm.eselect.in +++ b/src/modules/java-vm.eselect.in @@ -1,12 +1,12 @@ # -*-eselect-*- vim: ft=eselect -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 DESCRIPTION="Manage the Java system and user VM" MAINTAINER="java@gentoo.org" VERSION="@VERSION@" -VM_BASE="${EROOT}/usr/lib/jvm" +VM_BASE="${EPREFIX}/usr/lib/jvm" VM_SYSTEM="${EROOT}/etc/java-config-2/current-system-vm" VM_USER="${HOME}/.gentoo${EPREFIX}/java-config-2/current-user-vm" VM_CONFIG="${EROOT}/usr/share/java-config-2/vm" @@ -14,7 +14,7 @@ VM_CONFIG="${EROOT}/usr/share/java-config-2/vm" find_targets() { local TARGETS=() target - for target in "${VM_BASE}"/*; do + for target in "${ROOT}${VM_BASE}"/*; do [[ -L "${target}" ]] && TARGETS+=( ${target##*/} ) done @@ -181,7 +181,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 [[ -L ${ROOT}${VM_BASE}/${target} || -d ${ROOT}${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}" |