Use of libapt to fetch/parse Packages and Sources
As part of the work taking place to update wanna-build to use a
PostgreSQL backend, I'm looking at how to improve the way we
import package data into the database (currently done by hand
using quinn-diff). What we want to do is this:
For each architecture (including all), for each
given suite/component, we want to download the Packages and Sources
files. We then want to parse those files and inject the data into
I was wondering about the suitability of libapt for this purpose.
However, after looking at the public API, I'm not entirely sure
how to do this. I don't fully appreciate how abstracted various
parts of the system are, or which classes I would need to use.
For example, can I get the files without storing them in the
cache, or is the cache absolutely required. If the same package
is available in multiple suites/components, can I always
unambiguously distinguish them, even if identical?
If so, could I have a separate APT config, including sources.list
and cache directories (if required) to take care of this?
I saw the tagfile class handles parsing of the files, but are
there higher-level classes to represent individual binary and
source packages as objects in their own right?
Lastly, would this functionality also be available through the
I'm mainly looking at getting a handle on which bits of libapt-pkg
I need to do this. Are there any examples of this already, or
any overviews of how the various classes act together?
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.