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

Designing support to filter Packages/Sources file on download



Hi,

in simple terms what I want to do is filter the Packages/Sources files
after downloading them but before parsing them into the database. Uses
for this would be for example:

- Remove extra/optional packages to reduce memory footprint on small
  systems

- Remove games on a work machine so one isn't tempted to install any

- Limit 3rd party repositories. E.g. don't let them provide a bash
  package or any package already in debian.

- Only list library + dev packages for cross-compile architectures

- Only list libraries + binaries not in the native arch for multiarch

- Remove critical packages (bash, dash, apt, dpkg, type-handling) from
  foreign architectures so they can't be accidentally installed


Currently this can already be done using

  Apt::Update::Post-Invoke { "filter-packages"; };

where filter-packages goes through all downloaded Packages/Sources files
and filters them.

This has 2 problems:

1) It doesn't know which files have been downloaded so it has to look at
all of them every time

2) It has to modify the files in place preventing, at least without
bending backwards, the use of pdiff files.


So I'm inviting you all to come up with ideas to implement this better.

One idea would be to implement a filter as another apt method. That way
apt could easily pass options to the filter, e.g. Apt::Architecture and
Apt::Architectures. The filter would be called like apt calls gzip/bzip2
now but it would preserve the input file for use with pdiffs on the next
update.

MfG
        Goswin


Reply to: