Gentoo Archives: gentoo-dev

From: Jason Stubbs <jstubbs@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] getting installed packages list (portage api)
Date: Sat, 21 Feb 2004 15:17:07
Message-Id: 200402220015.13203.jstubbs@gentoo.org
In Reply to: Re: [gentoo-dev] getting installed packages list (portage api) by Jason Stubbs
1 On Saturday 21 February 2004 23:22, Jason Stubbs wrote:
2 > On Saturday 21 February 2004 10:46, Meir Kriheli wrote:
3 > > Hi,
4 > >
5 > > I looked over the API, and couldn't come with one. Is there a way to get
6 > > the list of emerged packages through portage's API, or should I go
7 > > over /var/db/pkg ?
8 >
9 > Never actually tried it before, but of the top of my head:
10 >
11 > db["/"]["vartree"].db.cpv_all() should return a list of "cat/pkg-ver"
12 > db["/"]["vartree"].db.cp_all() should return a list of "cat/pkg"
13
14 Err, make that db["/"]["vartree"].dbapi...
15
16 Regards,
17 Jason Stubbs
18
19 --
20 gentoo-dev@g.o mailing list