Gentoo Archives: gentoo-portage-dev

From: Mounir Lamouri <volkmar@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Daniel Buschke <damage@×××××××.de>
Subject: Re: [gentoo-portage-dev] Portage API questions
Date: Mon, 29 Jun 2009 17:33:55
Message-Id: 4A48FAF2.7090503@gentoo.org
In Reply to: [gentoo-portage-dev] Portage API questions by Sebastian Pipping
1 Hi,
2
3 My 2 cents:
4
5 Sebastian Pipping wrote:
6 > - installed packages with version numbers
7 >
8 vardb = portage.db[portage.settings["ROOT"]]["vartree"].dbapi
9 vardb.cpv_all() will return cat/package-version
10 vardb.cp_all() will return cat/package
11 of installed packages
12
13 > - entries for /var/lib/portage/world
14 >
15 You should think about world + system :
16
17 for s in ("system", "world"):
18 set = portage._sets.base.InternalPackageSet(
19 initial_atoms=rootconfig.setconfig.getSetAtoms(s))
20 for cp in set:
21 print cp # print cat/package in world/system
22
23 Good luck :)
24
25 Mounir