[Build-common-hackers] Bug#874769: cdbs: Use of /var/lib/apt/lists internals
Julian Andres Klode
jak at debian.org
Sat Sep 9 14:11:00 UTC 2017
User: deity at lists.debian.org
Dear Maintainer of cdbs,
your package appears to be relying on the internal layout of /var/lib/apt/lists
and the location of that directory (which is configurable), as it matches the
following regular expression (and a quick check did not rule out a false positive):
For the matches found, you can have a quick look at:
APT since some time supports compressed indices using the option
`Acquire::gzipIndexes`. Starting with 1.2, index files are stored
with lz4 compression if that option is enabled, providing significant
space savings at low overhead.
Some platforms and users might already have these indexes compressed by default
in order to save space, and your package might not be working for them.
Instead of relying on internals, please use the interfaces provided by
APT 1.1 and newer:
## Command-line interfaces
In order to get paths to index files, please use:
apt-get indextargets --format '$(FILENAME)' "Created-By: $creator"
where `$creator` is `Packages`, `Sources`, `Contents-deb`, `Contents-udeb`,
or `Contents-deb-legacy`, depending on which files you need.
To read the file, use
/usr/lib/apt/apt-helper cat-file <FILE>...
This transparently handles compression supported by apt.
## C++ interface
When reading files in C++, you might want to use APT's FileFd class. It
provides the same transparent compression support as `apt-helper cat-file`
(if turned on).
More information about the Build-common-hackers