Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 918693 - porttree dbapi.aux_get missing if there is no revision r0
Summary: porttree dbapi.aux_get missing if there is no revision r0
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - External Interaction (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-28 13:10 UTC by APN-Pucky
Modified: 2023-11-28 21:23 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description APN-Pucky 2023-11-28 13:10:41 UTC
Portage version: 3.0.51

coming from: https://github.com/slashbeast/pkg-testing-tools/issues/16

I have an ebuild sci-physics/looptools-2.16-r1.ebuild and _no_ sci-physics/looptools-2.16.ebuild. Then the look up for flags in dbapi/portree fails. If I however add the r0 ebuild sci-physics/looptools-2.16.ebuild. Then it works again.

Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/pkg-testing-tools-sUsJM4fC-py3.11/bin/pkg-testing-tool", line 6, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/apn/git/pkg-testing-tools/pkg_testing_tools/main.py", line 414, in main
    pkg_testing_tool(args, extra_args)
  File "/home/apn/git/pkg-testing-tools/pkg_testing_tools/main.py", line 350, in pkg_testing_tool
    for new_job in define_jobs(atom, args):
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/apn/git/pkg-testing-tools/pkg_testing_tools/main.py", line 242, in define_jobs
    package_metadata = get_package_metadata(atom)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/apn/git/pkg-testing-tools/pkg_testing_tools/main.py", line 133, in get_package_metadata
    iuse, ruse = get_package_flags(cpv)
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/apn/git/pkg-testing-tools/pkg_testing_tools/use.py", line 58, in get_package_flags
    flags = portage.db[portage.root]['porttree'].dbapi.aux_get(cpv, ['IUSE', 'REQUIRED_USE'])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/portage/dbapi/porttree.py", line 669, in aux_get
    return loop.run_until_complete(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
portage.exception.PortageKeyError: 'sci-physics/looptools-2.16'
Comment 1 Zac Medico gentoo-dev 2023-11-28 20:07:49 UTC
The dbapi.aux_get method is supposed to raise an error if the exact requested version does not exist. You can use the dbapi.match method if you want to match an atom, and then use the returned cpv(s) for aux_get calls.
Comment 2 Zac Medico gentoo-dev 2023-11-28 20:11:25 UTC
Note that the -r1 is considered part of the version, and dbapi.aux_get with 'sci-physics/looptools-2.16' as input is supposed to raise an error if the -r0 does not exist.
Comment 3 APN-Pucky 2023-11-28 21:23:15 UTC
Thanks! pkg-testing-tool was using portage.dep.dep_getcpv to get the cpv, but dbapi.match(...)[0] does the trick.