Gentoo Archives: gentoo-dev

From: magic-gentoo@××××××××××××××.de
To: gentoo-dev@l.g.o, "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-dev] speeding up usage of portage in e-file / portage file list
Date: Sat, 23 May 2020 20:36:30
Message-Id: 5d429d7c-f4d9-dd6c-3c05-36c217026a05@devloop.de
In Reply to: Re: [gentoo-dev] speeding up usage of portage in e-file / portage file list by "Michał Górny"
1 Hi,
2
3 Am 23.05.2020 um 22:08 schrieb Michał Górny:
4 > On Sat, 2020-05-23 at 22:02 +0200, magic-gentoo@××××××××××××××.de wrote:
5 >> I rewrote e-file in python by using the portage API [1]. But loading the
6 >> API slows down the whole script. Is there any way to speed up my
7 >> implementation? Have I done something fundamentally wrong?
8 >
9 > My only suggestion would be to use pkgcore instead of portage. It is
10 > compatible at configuration/data format level, so your script should
11 > work out of the box for Portage users.
12
13 Which makes me feel I did something fundamentally wrong :)
14
15 I used "portage.db['/']['vartree'].dbapi" and
16 "portage.db['/']['porttree'].dbapi" to get the API for installed
17 (vartree) and available (porttree) packages. This is not available ing
18 pkgcore. I haven't found a quick guide on how to use pkgcore but I will
19 have a further look.
20
21 Thanks
22 Daniel