Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 698256 - app-portage/gentoolkit: ekeyword does not work in Prefix
Summary: app-portage/gentoolkit: ekeyword does not work in Prefix
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-10-22 11:53 UTC by Michael Haubenwallner (RETIRED)
Modified: 2019-10-24 15:07 UTC (History)
1 user (show)

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


Attachments
proposed patch (0001-fix-for-Prefix-fix-for-main-repo-gentoo.patch,1.69 KB, patch)
2019-10-22 11:54 UTC, Michael Haubenwallner (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Haubenwallner (RETIRED) gentoo-dev 2019-10-22 11:53:18 UTC
There are two issues with ekeyword in Prefix:

1) $ ekeyword x86-linux ...
Traceback (most recent call last):
  File "/gentoo/prefix/32bit/usr/lib/python-exec/python3.6/ekeyword", line 41, in <module>
    ekeyword.main(sys.argv[1:])
  File "/gentoo/prefix/32bit/usr/lib/python3.6/site-packages/gentoolkit/ekeyword/ekeyword.py", line 527, in main
    if not portage_settings().get('NOCOLOR', 'false').lower() in ('no', 'false'):
  File "/gentoo/prefix/32bit/usr/lib/python3.6/site-packages/gentoolkit/ekeyword/ekeyword.py", line 346, in portage_settings
    return portage.db['/']['vartree'].settings
  File "/gentoo/prefix/32bit/usr/lib/python3.6/site-packages/portage/proxy/objectproxy.py", line 44, in __getitem__
    return object.__getattribute__(self, '_get_target')()[key]
KeyError: '/'

Here, using portage.root instead of '/' does help.


2) I do maintain a stable fork of Prefix, where the main-repo is not called "gentoo":
$ ekeyword x86-linux ...
Traceback (most recent call last):
  File "/gentoo/prefix/32bit/usr/lib/python-exec/python3.6/ekeyword", line 41, in <module>
    ekeyword.main(sys.argv[1:])
  File "/gentoo/prefix/32bit/usr/lib/python3.6/site-packages/gentoolkit/ekeyword/ekeyword.py", line 533, in main
    arch_status = load_profile_data()
  File "/gentoo/prefix/32bit/usr/lib/python3.6/site-packages/gentoolkit/ekeyword/ekeyword.py", line 361, in load_profile_data
    portdir = portage_settings().repositories[repo].location
  File "/gentoo/prefix/32bit/usr/lib/python3.6/site-packages/portage/repository/config.py", line 1021, in __getitem__
    return self.prepos[repo_name]
KeyError: 'gentoo'

Here, using portage_settings().repositories.mainRepo().name instead of 'gentoo' does help.
Comment 1 Michael Haubenwallner (RETIRED) gentoo-dev 2019-10-22 11:54:17 UTC
Created attachment 593612 [details, diff]
proposed patch

Thoughts? Is it worth to have two distinct commits?
Comment 2 Zac Medico gentoo-dev 2019-10-22 18:51:15 UTC
(In reply to Michael Haubenwallner from comment #1)
> Created attachment 593612 [details, diff] [details, diff]
> proposed patch
> 
> Thoughts? Is it worth to have two distinct commits?

Looks good. Yeah two commits will be nicer.
Comment 3 Larry the Git Cow gentoo-dev 2019-10-24 15:07:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=8d941d9c0e77eaab787df5f19ab97ca8a2fd6cff

commit 8d941d9c0e77eaab787df5f19ab97ca8a2fd6cff
Author:     Michael Haubenwallner <haubi@gentoo.org>
AuthorDate: 2019-10-24 15:05:35 +0000
Commit:     Michael Haubenwallner <haubi@gentoo.org>
CommitDate: 2019-10-24 15:05:56 +0000

    ekeyword: fix for when main-repo != "gentoo"
    
    Closes: https://bugs.gentoo.org/698256
    Signed-off-by: Michael Haubenwallner <haubi@gentoo.org>

 pym/gentoolkit/ekeyword/ekeyword.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=f2278785d6833e3e3358cd847280e9c9107f303e

commit f2278785d6833e3e3358cd847280e9c9107f303e
Author:     Michael Haubenwallner <haubi@gentoo.org>
AuthorDate: 2019-10-24 15:05:15 +0000
Commit:     Michael Haubenwallner <haubi@gentoo.org>
CommitDate: 2019-10-24 15:05:15 +0000

    ekeyword: fix for Prefix
    
    Bug: https://bugs.gentoo.org/698256
    Signed-off-by: Michael Haubenwallner <haubi@gentoo.org>

 pym/gentoolkit/ekeyword/ekeyword.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)