'portageq get_repo_path /eroot gentoo' returns the path from the host system, and no the passed in eroot Reproducible: Always Steps to Reproduce: 1. This script demonstrates the problem #!/bin/bash tmpdir=/tmp/portageq mkdir -p ${tmpdir}/etc/portage printf "[gentoo]\nlocation = /var/blah/portage\n" > \ ${tmpdir}/etc/portage/repos.conf portageq --version portageq repos_config ${tmpdir} | grep ^location portageq get_repo_path ${tmpdir} gentoo Actual Results: Portage 2.3.40 location = /var/blah/portage /usr/portage Expected Results: Should return /var/blah/portage in the last line (not /usr/portage) https://bugs.gentoo.org/489022 reports a similar problem, but that appears to work now for the portageq match
Here's a patch: --- /usr/lib/python-exec/python3.6/portageq 2018-07-26 23:57:43.000000000 +1000 +++ ./portageq 2018-11-01 23:29:43.285242218 +1000 @@ -882,6 +882,7 @@ master_repos.__doc__ = docstrings['master_repos'] +@uses_configroot @uses_eroot def get_repo_path(argv):
Created attachment 553810 [details, diff] portageq.patch Attached a patch
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=1cc3352b6580af95965e231b35e80627b8391df4 commit 1cc3352b6580af95965e231b35e80627b8391df4 Author: Bruce Schultz <brulzki@gmail.com> AuthorDate: 2018-11-02 19:04:52 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2018-11-02 19:14:13 +0000 portageq get_repo_path: fix <eroot> parameter (bug 670082) Use the @uses_configroot decorator to make portage get_repo_path respect the <eroot> parameter, like portage repos_config since commit 382f4be415394886026ccd5dcd08ca96ecda31fa. Bug: https://bugs.gentoo.org/670082 Signed-off-by: Zac Medico <zmedico@gentoo.org> bin/portageq | 1 + 1 file changed, 1 insertion(+)
Thanks!
The same problem exists for the commands get_repos, master_repos and master_repositories. Here's a simple script to demonstrate #!/bin/bash mkdir -p mkdir /tmp/portageq/etc/portage cat > /tmp/portageq/etc/portage/repos.conf <<EOF [gentoo] location = /var/blah/gentoo [overlay] location = /var/blah/overlay masters = gentoo EOF portageq --version portageq get_repos /tmp/portageq portageq master_repos /tmp/portageq overlay portageq master_repositories /tmp/portageq overlay Output: Portage 2.3.49 gentoo (the master_repos commands both print blank lines, because overlay does not exist on the host system) Expected output: overlay gentoo gentoo gentoo
Created attachment 554124 [details, diff] portageq-v2.patch Attaching another patch which fixes the get_repos and master_repos variants also. (Let me know it you would prefer I open a new bug for those)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=089a6082e7d115b7dc07862121f68b72d9f123f6 commit 089a6082e7d115b7dc07862121f68b72d9f123f6 Author: Bruce Schultz <brulzki@gmail.com> AuthorDate: 2018-11-19 07:22:53 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2018-11-19 07:22:53 +0000 portageq get_repos: fix <eroot> parameter (bug 670082) Use the @uses_configroot decorator to make portage get_repos respect the <eroot> parameter, like portage repos_config since commit 382f4be415394886026ccd5dcd08ca96ecda31fa. Apply the same fix to master_repositories and master_repos. Bug: https://bugs.gentoo.org/670082 Signed-off-by: Zac Medico <zmedico@gentoo.org> bin/portageq | 3 +++ 1 file changed, 3 insertions(+)
Fixed in portage-2.3.62.