Bug#752702: apt: please add a way to to retrieve the location of Packages/Sources files in /var/lib/apt/lists/
Hi,
Quoting Julian Andres Klode (2014-06-25 23:02:33)
> Well, as I said WRT on disk. We expose this, but you should most likely not
> use it without APT parsers, as it may not contain data you expect (for
> example, compressed indices). Using APT's parsers for those files is the best
> idea.
what are "compressed indices"? I expected files that identify as "Debian
Package Index" in my code snipped to always be deb822 format files? I never
encountered a situation in which they were not.
> You are reading the wrong list. You need to go through the cache, not the
> pkgSourceList. pkgSourceList give you IndexFiles, the cache gives you
> PackageFiles you can iterate over. You need to loop through the files in the
> cache starting at Cache->FileBegin() and ending at Cache->FileEnd(). This
> gives you pkgCache::PkgFileIterator() with stuff like FileName, Archive,
> Component, Version, Architecture.
but it gives me only binary packages and not source packages, right?
To come back to my original problem: /var/lib/apt/lists/ contains Packages and
Sources files and I want to know details about them. So far I only see how to
get the information in a way that isnt reliable because a string has to be
parsed or which limits me to binary packages. If some files in
/var/lib/apt/lists/ are not in deb822 format, there should be a way to find
that out too.
cheers, josch
Reply to: