Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 793965 - app-eselect/eselect-java: incorrect symlinks created when using ROOT
Summary: app-eselect/eselect-java: incorrect symlinks created when using ROOT
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
: 921973 (view as bug list)
Depends on:
Blocks: 561272
  Show dependency tree
 
Reported: 2021-06-02 19:54 UTC by SpanKY
Modified: 2024-04-20 11:30 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch (0001-java-vm.eselect-fix-symlink-target-when-ROOT-is-not.patch,1.75 KB, patch)
2024-04-19 18:28 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2021-06-02 19:54:48 UTC
src/modules/java-vm.eselect.in has this code:
VM_BASE="${EROOT}/usr/lib/jvm/"
...
set_symlink() {
...
    ln -snf "${VM_BASE}/${target}" "${symlink}"
...

that causes the target to be broken when installing into a root.
$ emerge --root /tmp/foo dev-java/openjdk-bin

then we see:
$ ls -l /etc/java-config-2/current-system-vm
lrwxrwxrwx 1 root root 33 Jun  2 15:36 /etc/java-config-2/current-system-vm -> /tmp/foo/usr/lib/jvm/openjdk-bin-11

the symlink target needs to use EPREFIX, not EROOT.
Comment 1 Volkmar W. Pogatzki 2024-04-19 04:58:38 UTC
*** Bug 921973 has been marked as a duplicate of this bug. ***
Comment 2 Mike Gilbert gentoo-dev 2024-04-19 18:28:37 UTC
Created attachment 891129 [details, diff]
patch

Here's a patch.
Comment 3 Larry the Git Cow gentoo-dev 2024-04-20 11:28:33 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=0e67f002afa93cbea82e077931111acb1fddb3f4

commit 0e67f002afa93cbea82e077931111acb1fddb3f4
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-04-19 18:26:28 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2024-04-20 11:28:28 +0000

    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>

 src/modules/java-vm.eselect.in | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Comment 4 Larry the Git Cow gentoo-dev 2024-04-20 11:30:43 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96f3d3c8939dbdf06c0e211d90729790898fca9e

commit 96f3d3c8939dbdf06c0e211d90729790898fca9e
Author:     Florian Schmaus <flow@gentoo.org>
AuthorDate: 2024-04-20 11:29:32 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2024-04-20 11:30:35 +0000

    app-eselect/eselect-java: add 0.5.1
    
    Closes: https://bugs.gentoo.org/793965
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 app-eselect/eselect-java/Manifest                  |  1 +
 app-eselect/eselect-java/eselect-java-0.5.1.ebuild | 35 ++++++++++++++++++++++
 2 files changed, 36 insertions(+)