Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 589908

Summary: app-eselect/eselect-java - unable to set system vm on prefix
Product: Gentoo Linux Reporter: Martin Mokrejš <mmokrejs>
Component: Current packagesAssignee: Java team <java>
Status: RESOLVED OBSOLETE    
Severity: normal CC: floppym, prefix
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log

Description Martin Mokrejš 2016-07-28 12:30:13 UTC
Prefixed installations of Gentoo are typically run under a non-privileged user. Therefore, eselect should not bother about me being not 'root'.

$ eselect java-vm set system 2
!!! Error: Sorry, you don't have enough premission to set system
exiting
$ eselect java-vm set user 2
$ eselect java-vm list
Available Java Virtual Machines:
  [1]   icedtea-bin-7 
  [2]   oracle-jdk-bin-1.8  user-vm

$ equery belongs eselect
 * Searching for eselect ... 
app-admin/eselect-1.4.5-r103 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
app-admin/eselect-1.4.5-r103 (/scratch/mmokrejs/gentoo_rap/usr/bin/eselect)
app-admin/eselect-1.4.5-r103 (/scratch/mmokrejs/gentoo_rap/usr/share/bash-completion/completions/eselect)
app-eselect/eselect-ctags-1.18 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
app-eselect/eselect-fontconfig-1.1-r1 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
app-eselect/eselect-java-0.2.0-r1 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
app-eselect/eselect-lib-bin-symlink-0.1.1 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
app-eselect/eselect-mesa-0.0.10 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
app-eselect/eselect-opengl-1.3.1-r4 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
app-eselect/eselect-pinentry-0.7 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
app-eselect/eselect-python-20160222 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
app-eselect/eselect-qtgraphicssystem-1.1.1 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
app-eselect/eselect-ruby-20151229 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
app-eselect/eselect-vi-1.1.9 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
app-eselect/eselect-xvmc-0.4 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
sys-devel/binutils-config-5-r2 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
sys-devel/gcc-config-1.8_p20160608 (/scratch/mmokrejs/gentoo_rap/usr/share/eselect)
$
Comment 1 Mike Gilbert gentoo-dev 2016-07-31 05:14:36 UTC
That error isn't coming from eselect, rather from java-vm.eselect.

And it isn't checking the uid, it is tesing if ${EROOT}/etc/java-config-2 is writable.

I suspect the issue is that EROOT is generally not set to anything outside of an ebuild context.
Comment 2 James Le Cuirot gentoo-dev 2016-07-31 09:11:55 UTC
(In reply to Mike Gilbert from comment #1)
> I suspect the issue is that EROOT is generally not set to anything outside
> of an ebuild context.

Nah, it does seem to be handled in /usr/bin/eselect. Other modules make use of it.

Martin, please show the output of:
fgrep EPREFIX /usr/bin/eselect
ls -la /scratch/mmokrejs/gentoo_rap/etc/java-config-2
Comment 3 James Le Cuirot gentoo-dev 2016-07-31 09:13:38 UTC
(In reply to James Le Cuirot from comment #2)
> fgrep EPREFIX /usr/bin/eselect
> ls -la /scratch/mmokrejs/gentoo_rap/etc/java-config-2

Oops, obviously I meant:
fgrep EPREFIX /scratch/mmokrejs/gentoo_rap/usr/bin/eselect
ls -la /scratch/mmokrejs/gentoo_rap/etc/java-config-2
Comment 4 Martin Mokrejš 2016-07-31 09:51:26 UTC
$ fgrep EPREFIX /scratch/mmokrejs/gentoo_rap/usr/bin/eselect
EPREFIX="/scratch/mmokrejs/gentoo_rap"
EROOT="${ROOT%${EPREFIX:+/}}${EPREFIX}"
$ ls -la /scratch/mmokrejs/gentoo_rap/etc/java-config-2
ls: cannot access '/scratch/mmokrejs/gentoo_rap/etc/java-config-2': No such file or directory
$ 

$ ls -la /scratch/mmokrejs/gentoo_rap/etc/java-config*
ls: cannot access '/scratch/mmokrejs/gentoo_rap/etc/java-config*': No such file or directory
$

Well, it never installed because of bug #561272
Comment 5 Martin Mokrejš 2016-07-31 09:59:19 UTC
Created attachment 442064 [details]
build.log

> Well, it never installed because of bug #561272

No, it does install at lest now but something is wrong because after merging (see attached build.log) I still do not have the file:

$ ls -la /scratch/mmokrejs/gentoo_rap/etc/java-config*
ls: cannot access '/scratch/mmokrejs/gentoo_rap/etc/java-config*': No such file or directory
$
Comment 6 Martin Mokrejš 2016-07-31 10:00:51 UTC
$ ls -la /scratch/mmokrejs/gentoo_rap/usr/bin/java-config*
lrwxrwxrwx 1 mmokrejs mmokrejs 13 Jul 31 11:56 /scratch/mmokrejs/gentoo_rap/usr/bin/java-config -> java-config-2
$
Comment 7 Mike Gilbert gentoo-dev 2016-07-31 14:23:40 UTC
(In reply to James Le Cuirot from comment #2)

Oh, duh! Thanks for setting me straight.
Comment 8 Fabian Groffen gentoo-dev 2021-01-06 13:06:51 UTC
assuming this is handled in the meanwhile