lintian

Langue: en

Version: June 21, 2008 (ubuntu - 24/10/10)

Section: 1 (Commandes utilisateur)

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 (the .deb file for a binary package or the .dsc file for a source package), 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.
-T tag1,tag2,..., --tags tag1,tag2,...
Run only the checks that issue the requested tags. The tests for other tags within the check scripts will be run but the tags will not be issued.
--tags-from-file filename
Same functionality as --tags, but read the list of tags from a file. Blank lines and lines beginning with # are ignored. All other lines are taken to be tag names or comma-separated lists of tag names to (potentially) issue.
-F, --ftp-master-rejects
Run only the checks that issue tags that result in automatic rejects from the Debian upload queue. The list of such tags is refreshed with each Lintian release, so may be slightly out of date if it has changed recently. This option does not, as yet, ignore overrides for fatal tags for which overrides aren't allowed.
-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 and only 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, --version
Display lintian version number and exit.
--print-version
Print unadorned version number and exit.
-v, --verbose
Display verbose messages.
-d, --debug
Display debugging messages. (Implies -v).
-q, --quiet
Suppress all informational messages. Currently, the only message this suppresses is the message at the end of the run giving the total count of overrides.

Behaviour options for lintian.

-i, --info
Print explanatory information about each problem discovered in addition to the lintian error tags. To print a long tag description without running lintian, see lintian-info(1).
-I, --display-info
Display informational ("I:") tags as well. They are normally suppressed. (This is equivalent to -L ">=wishlist").
-E, --display-experimental
Display experimental ("X:") tags as well. They are normally suppressed.

If a tag is marked experimental, this means that the code that generates this message is not as well tested as the rest of Lintian, and might still give surprising results. Feel free to ignore Experimental messages that do not seem to make sense, though of course bug reports are always welcomed (particularly if they include fixes).

--pedantic
Display pedantic ("P:") tags as well. They are normally suppressed.

Pedantic tags are Lintian at its most pickiest and include checks for particular Debian packaging styles and checks that many people disagree with. Expect false positives and Lintian tags that you don't consider useful if you use this option. Adding overrides for pedantic tags is probably not worth the effort.

-L [+|-|=][>=|>|<|<=][S|C|S/C], --display-level [+|-|=][>=|>|<|<=][S|C|S/C]
Fine-grained selection of tags to be displayed. It is possible to add, remove or set the levels to display, specifying a severity (S: serious, important, normal, minor, wishlist), a certainty (C: certain, possible, wild-guess), or both (S/C). The default settings are equivalent to -L ">=important" -L "+>=normal/possible" -L +minor/certain).
--suppress-tags tag1,tag2,...
Suppress the listed tags. They will not be reported if they occur and will not affect the exit status of Lintian.
--suppress-tags-from-file file
Suppress all tags listed in the given file. Blank lines and lines beginning with # are ignored. All other lines are taken to be tag names or comma-separated lists of tag names to suppress. The suppressed tags will not be reported if they occur and will not affect the exit status of Lintian.
-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 overridden.
--color (never|always|auto|html)
Whether to colorize tags in lintian output based on their severity. The default is "never", which never uses color. "always" will always use color, "auto" will use color only if the output is going to a terminal, and "html" will use HTML <span> tags with a color style attribute (instead of ANSI color escape sequences).
-U info1,info2,..., --unpack-info info1,info2,...
Collect information info1, info2, etc. even if these are not required by the checks.
-m, --md5sums, --checksums
Check checksums when processing a .changes file. Normally, Lintian only checks the checksums for .dsc files when processing a .changes file.
--allow-root
Override lintian's warning when it is run with superuser privileges.
--fail-on-warnings
By default, lintian exits with 0 status if only warnings were found. If this flag is given, exit with a status of 1 if either warnings or errors are found.
--keep-lab
By default, temporary labs will be removed after lintian is finished. Specifying this options will leave the lab behind, which might be useful for debugging purposes. You can find out where the temporary lab is located by running lintian with the --verbose option. Implies --unpack-level=2 unless another unpack level is specified directly.

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. (See the FILES section for complete information on how the path is constructed.) 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. (See the FILES section for complete information on how the path is constructed.) 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.
--area area
When scanning for packages in the distdir, select only packages from the comma-separated list of archive areas areas (e.g. main, contrib). This option overrides the LINTIAN_AREA environment variable and the configuration file entry of the same name.
--section area
This is an old name for the --area option and accepted as a synonym for that option.
--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', `u', or `s' (binary, udeb, 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)
This unpack level is deprecated and no longer functional. The unpacked collection script replaced it.

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.
changes-file (chng)
Check for various issues with .changes files.
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 the format of the binary package ar archive.
debconf (dc)
Looks for common mistakes in packages using debconf, like missing dependencies or errors in the template file.
debhelper (dh)
Looks for common mistakes in source packages using debhelper.
debian-readme (drm)
Check if the README.Debian file is merely the debmake template.
debian-source-dir (dsd)
Check the debian/source/* control files in source packages for errors.
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.
nmu (nmu)
Checks whether the package is consistent as to whether it is an NMU.
ocaml (ocaml)
Checks various things related to packaging of OCaml libraries and other software.
patch-systems (pat)
Check source package use of patch systems.
po-debconf (pd)
Looks for common mistakes in packages using po-debconf.
rules (rul)
Looks for common problems in the debian/rules file in source packages.
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.
standards-version (std)
Check if a source package contains a valid Standards-Version field in its debian/control file.
version-substvars (v-s)
Check use of version substvars in a source package, particularly whether the relationships between packages allow safe binary NMUs.
watch-file (watch)
Check debian/watch files in source packages.

COLLECTION

ar-info
Collects the results of "ar t" command for all *.a files in the package.
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, udeb, and source 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
strings
Collect the output of the strings(1) utility for each non-debug ELF object in a binary package.
unpacked
Unpack the contents of a source or binary package.

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:

/tmp
If no lab location is specified via the LINTIAN_LAB environment variable, configuration, or the --lab command-line option, lintian defaults to creating a temporary lab directory in /tmp. To change the directory used, set the TMPDIR environment variable to a suitable directory.
/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/data
Supporting data used by Lintian checks and for output formatting.
/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.

When looking for packages in a Debian archive, lintian constructs the path to the archive from the archivedir, distdir, release, andarch as follows:

archivedir/dists/distdir/release/arch

Lintian always expects the "/dists/" path component in paths to Debian archives.

For binary packages, Lintian looks for overrides in a file named usr/share/lintian/overrides/<package> inside the binary package, where <package> is the name of the binary package. For source packages, Lintian looks for overrides in debian/source/lintian-overrides and then in debian/source.lintian-overrides if the first file is not found. The first path is preferred. See the Lintian User's Manual for the syntax of overrides.

EXIT STATUS

0
No policy violations or major errors detected. (There may have been warnings, though.)
1
Policy violations or major errors 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.dsc -L +minor/possible
Check source package foo given by foo.dsc, including minor/possible tags.
$ 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 --archivedir /var/packages --dist custom --section main
Check all packages found in the Debian archive at /var/packages/dists/custom/main.
$ 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 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)

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.