Lintian User's Manual - chapter 3
Advanced usage
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):
- The package contents are unpacked in the laboratory (or
just lab).
- 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.
- The package contents are removed again (to save disk space),
but the statistics files produced in the last step remain in the
lab.
- 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.
- 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 current Debian archive contains about
1800 binary packages (architectures i386 and all) and about 1350
source packages. If all data is collected for all these packages, the
lab requires only about 200 megabytes, while the actual packages would
require over 1 gigabyte of disk space--in gzipped form!)
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:
$LINTIAN_LAB/
source/
<src-pkg-name>/
.lintian-status
dsc dsc file
foo.diff.gz
foo.orig.tar.gz (symlinks to actual files)
binary/
<binary 1> -> ../../../binary/<binary 1>
...
unpacked/ (opt., contains unpacked source package)
binary/
<bin-pkg-name>/
.lintian-status
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)
info/
binary-packages list of binary packages in archive
source-packages list of source packages in archive
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.)
Lintian User's Manual
- Copyright ©1998 Christian Schwarz and Richard Braakman
Contents; abstract; back.
version 0.3.2, 14 March 1998
Christian Schwarz schwarz@debian.org
Richard Braakman dark@xs4all.nl
Contact address: lintian-maint@debian.org