[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#752702: apt: please add a way to to retrieve the location of Packages/Sources files in /var/lib/apt/lists/



On Wed, Jun 25, 2014 at 11:30 PM, Johannes Schauer <j.schauer@email.de> wrote:
> 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 can enable storing them in compressed form without uncompressing
them first. APT transparently handles compressed files. We do not need
to store that information anywhere, because of that. As said, the
files in there are an implementation details and other packages using
them are not checked for breakage if a need for a change arises.

The same applies to /var/lib/dpkg as well I've been told.

>
>> 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?

Right, yes. David wanted to do some sort of sources in cache in the future IIRC.

The accessor things seems like the best idea then.

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.


Reply to: