Whole document tree

Whole document tree

Lintian User's Manual - Advanced usage
[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ next ]

Lintian User's Manual
Chapter 3 - Advanced usage

3.1 How Lintian works

Lintian is divided into the following layers:

the command line interface (currently, this layer consists of two scripts, namely lintian and lintian-info)
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).
  1. 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.
  1. The package contents are removed again (to save disk space), but the statistics files produced in the last step remain in the lab.
  1. 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.
  1. 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.

3.2 The laboratory

Lintian's laboratory directory can be defined via the LINTIAN_LAB variable (either in the configuration file or as environment variable). If this variable is not defined, Lintian creates a temporary lab in /tmp which is removed again after Lintian has completed its checks. This mode is called temporary lab mode.

In the static lab mode (if the laboratory directory is defined by the user), the laboratory has to be set up first before it can be used by Lintian. This can be done with the -S (or --setup-lab) command line option (see also the next section about the distribution directory).

Here is a sketch of the Lintian laboratory:

             dsc                 dsc file
             foo.orig.tar.gz     (symlinks to actual files)
     	     <binary 1> -> ../../../binary/<binary 1>
     	unpacked/           (opt., contains unpacked source package)
             index               (output of `dpkg -c')
             control-index       (same for the control.tar.gz of the pkg)
             control/            (contains all control files)
             fields/             (contains all control field settings)
     	source -> ../../source/<source pkg>
             deb                 (symlink to actual file)
     	unpacked/           (opt., contains unpacked binary package)
             binary-packages     list of binary packages in archive
     	source-packages     list of source packages in archive

3.3 Distribution directory

If you want to check the full Debian distribution with Lintian, you have to set up the LINTIAN_DIST variable in the configuration file (or as environment variable). Then, you have to run lintian -S to set up the laboratory and to create lists of all binary and source packages in the distribution. (Note, that this might take some time...)

After that, you can either check single packages simply be running

       $ lintian foo

(without path or extension for the package foo) or check the whole distribution with

       $ lintian --all

Since Lintian needs an up-to-date list of packages in the distribution, you'll have to rerun the lintian -S command whenever the distribution directory has been changed. (But there is no need to remove the laboratory in this situation: Lintian is smart enough to only re-unpack packages that have been changed.)

[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ next ]

Lintian User's Manual

version 0.3.3, 6 September 2000
Christian Schwarz schwarz@debian.org
Richard Braakman dark@xs4all.nl
Sean 'Shaleh' Perry shaleh@debian.org
Contact address: lintian-maint@debian.org