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

Bug 670558

Summary: portageq eclass_path fails with eroot parameter
Product: Portage Development Reporter: Bruce Schultz <brulzki>
Component: CoreAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=670082
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: demonstrates a number of test case

Description Bruce Schultz 2018-11-06 20:48:09 UTC
portageq eclass_path always searches in the host repo, even when the eroot parameter is provided.

In this case, it is not as simple as overriding the configroot for the eclass_path command. Although that then does map to the correct repo, portage fails to find the eclass within that repo unless the repo path provided in the eroot is relative to the host's root.

Reproducible: Always

Steps to Reproduce:
The following script demonstrates the problem:
#!/bin/bash
mkdir -p /tmp/portageq/etc/portage
cat > /tmp/portageq/etc/portage/repos.conf <<EOF
[gentoo]
location = /var/blah/gentoo
EOF
mkdir -p /tmp/portageq/var/blah/gentoo/eclass
touch /tmp/portageq/var/blah/gentoo/eclass/user.eclass
portageq --version
portageq eclass_path /tmp/portageq gentoo user


A more comprehensive test script will be attached

Actual Results:  
Portage 2.3.49
/usr/portage/eclass/user.eclass

It always locates an eclass within the host's repos.

However, when portageq is modified with @uses_configroot for eclass_path, the output is blank.


Expected Results:  
Should always be able to find the eclass within the eroot repo.

I expect the example above should output:
/var/blah/gentoo/eclass/user.eclass
Comment 1 Bruce Schultz 2018-11-06 20:51:54 UTC
Created attachment 554322 [details]
demonstrates a number of test case

To use the system installed portageq, run the test as:

./test-portageq-eclass_path.sh

To run with a modified portageq, define a portageq variable pointing to that instance; eg:

portageq=./portageq ./test-portageq-eclass_path.sh