Chapter 3. Advanced usage

3.1. How Lintian works

Lintian is divided into the following layers:

frontend

the command line interface (currently, this layer consists of two scripts, namely lintian and lintian-info)

checkers

a set of scripts that check different aspects of binary or source packages

data collectors

a set of scripts that prepares specific information about a package needed by the checker scripts

unpacking scripts

a set of scripts that unpack binary and source packages and extract some basic information about the package contents

bug reporting scripts

a collection of scripts to report bugs and keep track of them afterwards

When you check a package with Lintian, the following steps are performed (not exactly in this order—but the details aren't important now):

  1. The package contents are unpacked in the laboratory (or just lab).

  2. Some data is collected about the package. (That's done by the so-called collector scripts.) For example, the file program is run on each file in the package and the output is saved in the file-info file in the lab.

  3. The package contents are removed again (to save disk space), but the statistics files produced in the last step remain in the lab.

  4. The checker scripts are run over the package and report any discovered policy violations or other errors. These scripts don't access the package contents directly, but use the collected data as input.

  5. Depending on the lab mode Lintian uses (see below), the whole lab directory is removed again.

This separation of the checker scripts from the unpacking tools and the data collector scripts makes it possible to run Lintian several times over a package without having to unpack the package each time. In addition, the checker scripts don't have to worry about packaging details since they just access the statistics files (not the package files directly).

Furthermore, since it is sufficient to save the statistics files of each package in order to run the checks, one can store these files for all packages of the Debian archive if one wants to check the whole distribution several times. The space savings is substantial and continues to grow as the archive does.