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
There is no good portage API now. so portage devs are making new portage API. See http://www.gentoo.org/proj/en/portage/