Gentoo Archives: gentoo-portage-dev

From: Tom Hosiawa <tomek32@×××××.com>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] accessing portage updates through it's data structures
Date: Tue, 18 Apr 2006 04:20:26
Message-Id: c12dd7080604172120t678d69fdsd73ccbc962cb6b37@mail.gmail.com
1 I'm writing a superkaramba theme for showing the current available
2 updates on a system (www.tomek.ca for an example), but I'm having
3 trouble parsing the list into seperate properties for each ebuild
4 (package name, version, use flag).
5
6 Right now, I'm trying get the ebuild information through parsing the
7 output of emerge with regular expressions in python. But I'm running
8 into problems when a package doesn't have any use flags and when a
9 package name has a hypen in it.
10
11 I'm wondering if it's possible, to somehow call emerge from within my
12 superkaramba python program and get all the details of each ebuild
13 from the portage data structures directly? I'm thinking this might be
14 a little easier than trying to figure out the perfect regular
15 expression to handle all the different formats possible, but I'm not
16 familiar enough with python/portage to know how to do this.
17
18 Anybody have any ideas how I can basically do 'emerge -puDNv' directly
19 from my superkaramba python program, and get the updates available
20 directly from the portage data structures?
21 --
22 Tom
23
24 --
25 gentoo-portage-dev@g.o mailing list

Replies