Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 47190 - ebuild does not exist using find_all_installed_packages()
Summary: ebuild does not exist using find_all_installed_packages()
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-08 01:06 UTC by Juan F. Codagnone
Modified: 2004-04-09 18:48 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 Juan F. Codagnone 2004-04-08 01:06:38 UTC
I was trying to play with portage functions, when i first wrote:
------8<----------------8<--------
#!/usr/bin/python
import sys

sys.path.insert(0, "/usr/lib/gentoolkit/pym")
import gentoolkit

for pkg in gentoolkit.find_all_installed_packages():
        print pkg.get_env_var('SRC_URI')
------8<----------------8<--------
Running it, i get an exception:
...
------8<----------------8<--------
!!! aux_get(): ebuild for 'app-text/docbook-xsl-stylesheets-1.62.0' does not exist at:
!!!            /usr/portage/app-text/docbook-xsl-stylesheets/docbook-xsl-stylesheets-1.62.0.ebuild

Traceback (most recent call last):
  File "./main.py", line 8, in ?
    print pkg.get_env_var('SRC_URI')
  File "/usr/lib/gentoolkit/pym/gentoolkit.py", line 132, in get_env_var
    r=porttree.dbapi.aux_get(self._cpv,[var])
  File "/usr/lib/portage/pym/portage.py", line 4518, in aux_get
    raise KeyError
KeyError
------8<----------------8<--------

That is correct: the ebuild doesn't live anymore at that path (emerge sync ...), but we can find it at /var/db/pkg/app-text/docbook-xsl-stylesheets-1.62.0/docbook-xsl-stylesheets-1.62.0.ebuild because we know it is an installed Package.

I have the filling that this is a mised case, but in the other hand i don't know if it is a valid interfase.

Regards,
    Juan.

ps. using Portage 2.0.50-r3 and gentoolkit-0.2.0_pre8

Reproducible: Always
Steps to Reproduce:
see details
Comment 1 Masatomo Nakano (RETIRED) gentoo-dev 2004-04-09 18:48:04 UTC
There is no good portage API now.
so portage devs are making new portage API.
See http://www.gentoo.org/proj/en/portage/