man lintian (Commandes) - Debian package checker

NAME

lintian - Debian package checker

SYNOPSIS

lintian [action] [options] [packages] ...

DESCRIPTION

Lintian dissects Debian packages and reports bugs and policy violations. It contains automated checks for many aspects of Debian policy as well as some checks for common errors. It uses an archive directory, called laboratory, in which it stores information about the packages it examines. It can keep this information between multiple invocations in order to avoid repeating expensive data-collection operations. There are three ways to specify binary, udeb or source packages for Lintian to process: by file name, by package name, or by naming a .changes file. If you list packages by package name, you'll have to define the LINTIAN_DIST variable in the configuration file (see below). Lintian will then search for any binary or source packages in this directory for packages with the given name. (You can use the -b (--binary), --udeb and -s (--source) options if you only want to process binary, udeb or source packages.)

If you specify a .changes file, Lintian will process all packages listed in that file. This is convenient when checking a new package before uploading it.

OPTIONS

Actions of the lintian command: (Only one action can be specified per invocation)

-S, --setup-lab
Set up or update the laboratory.
-R, --remove-lab
Remove the laboratory directory.
-c, --check
Run all checks over the specified packages. This is the default action.
-C chk1,chk2,..., --check-part chk1,chk2,...
Run only the specified checks. You can either specify the name of the check script or the abbreviation. For details, see the CHECKS section below.
-X chk1,chk2,..., --dont-check-part chk1,chk2,...
Run all but the the specified checks. You can either specify the name of the check script or the abbreviation. For details, see the CHECKS section below.
-u, --unpack
Unpack the specified packages up to the current unpack level. The default unpack level is 1 for this option. See the UNPACK LEVELS section below.
-r, --remove
Clean up the lintian directory of the specified packages up to the current unpack level. The default unpack level is 0 for this option.

General options:

-h, --help
Display usage information and exit.
-v, --verbose
Display verbose messages.
-V, --version
Display lintian version number and exit.
-d, --debug
Display debugging messages. (Implies -v).
--print-version
Print unadorned version number and exit.

Behaviour options for lintian.

-i, --info
Print explanatory information about discovered policy violations in addition to the lintian error tags.
-I, --display-info
Display informational ("I:") tags as well. They are normally suppressed.
-l n, --unpack-level n
Set unpack level to n. See the UNPACK LEVELS section, below.
-o, --no-override
Don't use the overrides file.
--show-overrides
Output tags that have been overriden
-U info1,info2,..., --unpack-info info1,info2,...
Collect information info1, info2, etc. even if these are not required by the checks.
-m, --md5sums
Check md5sums when processing a .changes file. Normally, Lintian only checks the md5sums for .dsc files when processing a .changes file.
--allow-root
Override lintian's warning when it is run with superuser privileges.

Configuration options:

--cfg configfile
Read the configuration from configfile rather than the default locations. This option overrides the LINTIAN_CFG environment variable.
--lab labdir
Use labdir as the permanent laboratory. This is where Lintian keeps information about the packages it checks. This option overrides the LINTIAN_LAB environment variable and the configuration file entry of the same name.
--archivedir archivedir
Location of Debian archive to scan for packages. Use this if you want Lintian to check the whole Debian archive instead of just single packages. This option overrides the LINTIAN_ARCHIVEDIR environment variable and the configuration file entry of the same name.
--dist distdir
Scan for packages in the distdir directory. Use this if you want Lintian to check the whole Debian archive instead of just single packages. This option overrides the LINTIAN_DIST environment variable and the configuration file entry of the same name.
--section release
When scanning for packages in the distdir, select only packages from section section (e.g. main). This option overrides the LINTIAN_SECTION environment variable and the configuration file entry of the same name.
--arch arch
When scanning for packages in the distdir, select only packages for architecture arch. This option overrides the LINTIAN_ARCH environment variable and the configuration file entry of the same name.
--root rootdir
Look for lintian's support files (such as check scripts and collection scripts) in rootdir. This overrides the LINTIAN_ROOT environment variable. The default location is /usr/share/lintian.

Package selection options:

-a, --all
Check all packages in the distribution. (This requires that the LINTIAN_DIST variable is defined in the configuration file.)
-b, --binary
The following packages listed on the command line are binary packages.
-s, --source
The following packages listed on the command line are source packages.
--udeb
The following packages listed on the command line are udeb packages.
-p, --packages-file X
Process all packages which are listed in file X. Each package has to be listed in a single line using the following format: type package version file where type is either `b' or `s' (binary or source package), package is the package name, version is the package's version, and file is the package file name (absolute path specification).

UNPACK LEVELS

0 (none)
The package does not exist in the laboratory at all.
1 (basic)
A directory for this package exists in the laboratory and basic information is extracted. This does not take much space.

For binary and udeb packages, the control and fields directories and the index file are unpacked, and symbolic links are made to the .deb file and to the lintian directory for the source package.

For source packages, the binary and fields directories are unpacked, and symbolic links are made to the source package files.

2 (contents)
The actual package contents are unpacked as well.

Lintian will unpack packages as far as is necessary to do its checks, but it will leave the package in whatever unpack level was specified when it is done.

The default unpack level can be overwritten by setting the LINTIAN_UNPACK_LEVEL variable in the configuration file.

CHECKS

binaries (bin)
Search for bugs in binaries and object files.
changelog-file (chg)
Check changelog files in a binary package.
conffiles (cnf)
Check if the conffiles control file of a binary package is correct.
control-file (dctl)
This script checks debian/control files in source packages.
control-files (ctl)
Check for unknown control files in the binary package.
copyright-file (cpy)
Check if a binary package conforms to policy with respect to the copyright file. Each binary package must either have a /usr/share/doc/package/copyright file or must have a symlink /usr/share/doc/package->foo, where foo comes from the same source package, and this package declares a "Depends" relation on foo.
cruft (deb)
Looks for cruft in source packages, like files of version control systems and temporary files from the build process.
deb-format (dfmt)
Checks if a binary package was build with a broken version of tar so that dpkg can't handle it correctly.
debconf (dc)
Looks for common mistakes in packages using debconf, like missing dependencies or errors in the template file.
debdiff (dif)
Look for .orig and .rej files in the Debian diffs.
debian-readme (drm)
Check if the README.Debian file is merely the debmake template.
debhelper (dh)
Looks for common mistakes in source packages using debhelper.
description (des)
Check if the Description control field of a binary package conforms to the rules in the Policy Manual (section 3.4).
etcfiles (etc)
Checks if all files in /etc that are shipped with the package are marked as conffiles as required by policy.
fields (fld)
Check control fields of a binary or source package.
files (fil)
Check if a binary package conforms to policy with respect to types, permissions and ownerships of files and directories.
huge-usr-share (hus)
Checks whether an architecture-dependent package does have a significantly big /usr/share. Big amounts of architecture independent data in architecture dependent packages waste space on the mirrors.
infofiles (info)
Check if a binary package conforms to policy with respect to info documents.
init.d (ini)
Check if a binary package conforms to policy with respect to scripts in /etc/init.d.
manpages (man)
Check if a binary package conforms to policy with respect to manual pages.
md5sums (md5)
If the md5sum control file of a binary package exists, check if it is valid.
menus (men)
Check if a binary package conforms to policy with respect to menu and doc-base files.
menu-format (mnf)
Check the syntax of menu files installed by the package.
perl (prl)
Check perl scripts installed by the package for the usage of perl modules, and check that the package declares the appropriate dependencies.
po-debconf (pd)
Looks for common mistakes in packages using po-debconf.
scripts (scr)
Check the the #! lines of scripts in a binary package.
shared-libs (shl)
Check if a binary package conforms to policy with respect to shared libraries and the shlibs control file.
spelling (spl)
Check a binary package's "Description:" field and copyright file for common spelling errors.
standards-version (std)
Check if a source package contains a valid Standards-Version field in its debian/control file.

COLLECTION

changelog-file
Copy the changelog file of a package into the lintian directory.
copyright-file
Copy the copyright file of a package into the lintian directory.
debfiles
Collects files shipped in the source of the package.
debian-readme
Copy the README.Debian file of a package into the lintian directory.
diffstat
Collect the output of the diffstat(1) utility for the Debian diff in a source package.
doc-base-files
Copy the contents of /usr/share/doc-base into the lintian directory (below doc-base).
file-info
Collect the output of the file(1) utility for each file in a binary package.
init.d
Copy /etc/init.d scripts into the lintian directory (below init.d).
md5sums
Collect the md5sums of all files in a binary package.
menu-files
Copy the contents of a binary package's usr/share/doc/menu directory into the menu directory in the lab.
objdump-info
Collect the output of the objdump(1) utility for each file in a binary package.
override-file
Copy the override file of a package into the lintian directory
scripts
Collect information about scripts in binary package.
source-control-file
Collects information about binary packages from debian/control in source packages

FILES

Lintian looks for its configuration file in the following locations:

The directory given with the --cfg option
$LINTIAN_CFG
$LINTIAN_ROOT/lintianrc
$HOME/.lintianrc
/etc/lintianrc

Lintian uses the following directories:

/usr/share/lintian/checks
Scripts that check aspects of a package.
/usr/share/lintian/collection
Scripts that collect information about a package and store it for use by the check scripts.
/usr/share/lintian/info
Information used by lintian collected from external sources.
/usr/share/lintian/lib
Utility scripts used by the other lintian scripts.
/usr/share/lintian/unpack
Scripts that manage the laboratory.

The /usr/share/lintian directory can be overridden with the LINTIAN_ROOT environment variable or the --root option.

EXIT STATUS

0
No policy violations (errors) detected. (There might have been warnings, though.)
1
Policy violations detected.
2
Lintian run-time error. An error message is sent to stderr.

USAGE

Examples:

$ lintian foo.deb
Check binary package foo given by foo.deb.
$ lintian foo.dsc
Check source package foo given by foo.dsc.
$ lintian foo
Search for package foo in the Debian archive and check it. (Depending on what is found, this command will check either the source or binary package foo, or both.)
$ lintian -i foo.changes
Check the changes file and, if listed, the source and binary package of the upload. The output will contain detailed information about the reported tags.
$ lintian -c --binary foo
Search for binary package foo in the Debian archive and check it.
$ lintian -C cpy --source foo
Run the copyright checks on source package foo.
$ lintian -u foo
Unpack package foo in the Lintian laboratory up to level 1. (If it's already unpacked at level 1 or 2, nothing is done.)
$ lintian -l1 -r foo
Search for package foo in the Debian archive and, if found, reduce the package disk usage in the laboratory to level 1.
$ lintian -r foo
Remove package foo from the Lintian laboratory.

BUGS

Lintian does not handle packages with different binary and source version numbers correctly. Lintian does not have any locking mechanisms yet. (Running several checks simultaneously is likely to fail.) If you discover any other bugs in Lintian, please contact the authors.

SEE ALSO

lintian-info(1), Lintian User's Manual (file:/usr/share/doc/lintian/lintian.html/index.html)

Packaging tools: debhelper(7), dh_make(8), dpkg-buildpackage(1)

Package checkers: linda(1)

AUTHORS

Richard Braakman <dark@xs4all.nl>

Christian Schwarz <schwarz@monet.m.isar.de>

Please use the email address <lintian-maint@debian.org> for Lintian related comments.