#874774 live-build: Use of /var/lib/apt/lists internals

Package:
live-build
Source:
live-build
Submitter:
Julian Andres Klode
Date:
2024-11-03 16:54:01 UTC
Severity:
important
Tags:
#874774#5
Date:
2017-09-09 14:11:07 UTC
From:
To:
Dear Maintainer of live-build,

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):

    /var/lib/apt/lists/.*(Packages|Sources)

For the matches found, you can have a quick look at:

https://codesearch.debian.net/search?q=%2Fvar%2Flib%2Fapt%2Flists%2F.*%28Packages%7CSources%29+package%3Alive-build

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).

#874774#10
Date:
2017-09-12 08:14:04 UTC
From:
To:
live-build is copying those files in a cache to avoid having to download
the files multiple times (when switching between various sources.list).

We could use "apt-get indextargets" to find out the files to copy. But
what's the right way to find where to copy the files back? Keep a trace
of the original path or is there an "apt-config" invocation that can give
us the path directly?

Also how are compressed files named? Do they get a new extension and they
are stored in the same directory?

Cheers,

#874774#15
Date:
2024-11-03 16:36:22 UTC
From:
To:
It has been now more than 7 years ago since the bug report was written.
My own (trixie/testing) system does not contain compressed versions of
these files.

I'm lowering the severity of this bug.

With kind regards,
Roland Clobus