lintian
Static analysis tool for Debian packages
- Provided by: lintian (Version: 2.5.43ubuntu0.1)
- Report a bug
Static analysis tool for Debian packages
lintian [action] [options] [packages] ...
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 naming a .changes file, or by using a lab query (see "LAB QUERY" below).
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.
If you specify packages to be checked or use the option --packages-from-file, the packages requested will be processed. Otherwise, if debian/changelog exists, it is parsed to determine the name of the .changes file to look for in the parent directory (when using the actions --check or --unpack). See "CHECKING LAST BUILD" for more information.
Actions of the lintian command: (Only one action can be specified per invocation)
This is implemented via a profile and thus this option cannot be used together with --profile.
With this options all tags listed will be displayed regardless of the display settings.
With this options all tags listed will be displayed regardless of the display settings.
Note in this option will also run all collections. See the "COLLECTION" section below.
General options:
This option is silently ignored if --debug is given. Otherwise, if both --verbose and --quiet is used, the last of these two options take effect.
This option overrides the verbose and the quiet variable in the configuration file. In the configuration file, this option is enabled by using quiet variable. The verbose and quiet variables may not both appear in the config file.
If --debug is used this option is always enabled. Otherwise, if both --verbose and --quiet is used (and --debug is not used), the last of these two options take effect.
This option overrides the quiet variable in the configuration file. In the configuration file, this option is enabled by using verbose variable. The verbose and quiet variables may not both appear in the config file.
Behaviour options for lintian.
This option overrides the color variable in the configuration file.
B<-L> ">=important" B<-L> "+>=normal/possible" B<-L> "+minor/certain"
The primary use for this is to ensure that lintian's display level has been reset to the built-in default values. Notably, this can be used to override display settings earlier on the command-line or in the lintian configuration file.
Further changes to the display level can be done after this option. Example: --default-display-level --display-info gives you the default display level plus informational ("I:") tags.
The entire list of sources can be found in $LINTIAN_ROOT/data/output/manual-references
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 welcome (particularly if they include fixes).
These options overrides the display-experimental variable in the configuration file.
This option overrides the fail-on-warnings variable in the configuration file.
This option overrides info variable in the configuration file.
This option overrides the display-info variable in the configuration file.
Note: display-level and display-info may not both appear in the configuration file.
The value consists of 3 parts, where two of them are optional. The parts are:
The default value is "=" (i.e. set the display level).
The selected values includes only items where both the severity and the certainty are both included in the set.
As an example, ">=important/possible" includes "important/possible", "important/certain", "serious/possible" and "serious/certain". Note that it does not include "serious/wild-guess" (since it does not satisfy the lower-bound for the certainty).
The default value is "=", which means "exactly" the given severity or/and certainty.
If only a severity or a certainty is given, the other one defaults to "any" as in "any certainty with the given severity" (or vice versa).
This option overrides the display-level variable in the configuration file. The value of the display-level in configuration file should be space separated entries in the same format as passed via command-line.
Note: display-level may not be used with display-info or pedantic in the configuration file.
This option overrides the override variable in the configuration file.
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.
This option overrides the pedantic variable in the configuration file.
Note: pedantic and display-level may not both appear in the configuration file.
As an example, if you are on Ubuntu and want to use Lintian's Debian checks, you can use:
--profile debian
Likewise, on a Debian machine you can use this to request the Ubuntu checks.
If the token {VENDOR} appears in the profile name, lintian will substitute the token with a vendor name to find the profile. lintian uses Dpkg::Vendor to determine the best vendor to use (the closer to the current vendor, the better). This is mostly useful for people implementing their own checks on top of Lintian.
If not specified, the default value is {VENDOR}/main.
Please Refer to the Lintian User Manual for the full documentation of profiles.
The --show-overrides differs from --no-overrides in that shown overridden tags will still be marked as overridden (using an "O" code).
If the overridden tags are shown, the related override comments will also be displayed (unless --quiet is used). Please refer to the Lintian User Manual for the documentation on how lintian relates comments to a given override.
These options override the show-overrides variable in the configuration file.
This option can be used together with --dont-check-part ("Not those checks nor these tags") and --check-part ("Only those checks, but not these tags (from those checks)") to further reduce the selection of tags.
When used with --tags, this option is mostly ignored.
Tags parsed from the file will be handled as if they had been given to the --suppress-tags option (e.g. ignored if --tags is used).
When STDOUT is not a TTY, lintian has no limit.
Configuration options:
This option is mostly useful for applications running lintian for checking packages and do not want the invoking user to affect the result (by setting LINTIAN_PROFILE etc.).
Note it does not cause lintian to ignore the entire environment like TMPDIR or DEB_VENDOR. The latter can affect the default profile (or "{VENDOR}" token for --profile).
Should usually be combined with --no-user-dirs (or unsetting $HOME and all XDG_ variables).
lintian will check this directory for (additional) profiles, data files, support libraries and checks. The latter two implies that Lintian may attempt to load and execute code from this directory.
This option may appear more than once; each time adding an additional directory. Directories are searched in the order they appear on the command line.
The additional directories will be checked after the user directories (though see --no-user-dirs) and before the core LINTIAN_ROOT.
Note: This option should be the very first if given.
This option overrides the jobs variable in the configuration file.
By default Lintian will use nproc to determine a reasonable default (or 2, if the nproc fails).
These options will not affect the inclusion of LINTIAN_ROOT, which is always included.
These option can appear multiple times, in which case the last of them to appear determines the result.
Note that if the intention is only to disable the user's $HOME, then unsetting $HOME and XDG_*_HOME may suffice. Alternatively, /etc can be "re-added" by using --include-dir (caveat: /etc/lintianrc will be ignored by this).
If the intention is to avoid (unintentional) side-effects from the calling user, then this option could be combined with --ignore-lintian-env.
If for some reason --no-user-dirs cannot be used, then consider unsetting $HOME and all the $XDG_* variables (not just the $XDG_*_HOME ones).
Note: This option should be the very first if given.
Developer/Special usage options:
For static (non-temporary) labs this option causes Lintian to skip the automatic clean up of some collections.
Otherwise the line is read as the path to a file to process (all whitespace is included!).
If X is "-", Lintian will read the packages from STDIN.
The data logged and the format used is subject to change with every release.
Note that some of the information may also be available (possibly in a different format) with the --debug option.
If the first character of OUTPUT is a & and the rest of argument is a number N, then lintian attempts to write it to the file descriptor with the number N. Said file descriptor must be open for writing. E.g &2 makes Lintian write the performance logging to STDERR.
If the first character of OUTPUT is a +, Lintian will append to the file rather than truncating it. In this case, the file name is OUTPUT with initial "+" character removed. E.g. +my-file makes Lintian append to my-file
If Lintian should write the output to a file starting with a literal '&' or '+', then simply prefix it with "./" (e.g. "+my-file" becomes "./+my-file").
If this option omitted, Lintian will default to using STDOUT.
This option is mostly useful for debugging or special purpose setups.
It is allowed to give this option more than once. The following two lines of arguments are semantically equivalent:
-U info1 -U info2
-U info1,info2
Each binary package with a /usr/share/doc/<foo> directory must have a Debian changelog file in changelog.Debian.gz unless the Debian changelog and the upstream one is the same file; in this case, it must be in changelog.gz.
If there is an upstream changelog file, it must be named "changelog.gz".
Both changelog files should be compressed using "gzip -9". Even if they start out small, they will become large with time.
Each binary package must either have a /usr/share/doc/<foo>/copyright file or must have a symlink /usr/share/doc/<foo> -> <bar>, where <bar> comes from the same source package and pkg foo declares a "Depends" relation on bar.
Each source package should have a debian/copyright file.
This collection is auto-removed by default in static labs.
This collection is auto-removed by default in static labs.
The format is: scriptpath filename
Note that the filename might contain spaces, but the scriptpath will not, because linux only looks at the first word when executing a script.
This collection is auto-removed by default in static labs.
This collection is auto-removed by default in static labs.
Lintian looks for its configuration file in the following locations:
Deprecated in Lintian/2.5.12 and newer (use the XDG based variant above)
Where XGD_DIR is a directories listed in $XDG_CONFIG_DIRS (or /etc/xdg if $XDG_CONFIG_DIRS is unset).
Deprecated in Lintian/2.5.12 and newer (use the XDG based variant above)
Lintian uses the following directories:
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.
The configuration file can be used to specify default values for some options. The general format is:
option = value
All whitespace adjacent to the "=" sign as well as leading and trailing whitespace is ignored. However whitespace within the value is respected, as demonstrated by this example:
# Parsed as "opt1" with value "val1"
opt1 = val1
# Parsed as "opt2" with value "val2.1 val2.2 val2.3"
opt2 = val2.1 val2.2 val2.3
Unless otherwise specified, no option may appear more than once. Lintian will ignore empty lines or lines starting with the #-character.
Generally options will be the long form of the command-line option without the leading dashes. There some exceptions (such as --profile), where Lintian uses the same name as the environment variable.
Lintian only allows a subset of the options specified in the configuration file; please refer to the individual options in "OPTIONS".
In the configuration file, all options listed must have a value, even if they do not accept a value on command line (e.g. --pedantic). The values "yes", "y", "1", or "true" will enable such a option and "no", "n", "0" or "false" will disable it. Prior to the 2.5.2 release, these values were case sensitive.
For other options, they generally take the same values as they do on the command line. Though some options allow a slightly different format (e.g. --display-level). These exceptions are explained for the relevant options in "OPTIONS".
Beyond command line options, it is also allowed to specify the environment variable "TMPDIR" in the configuration file.
A sample configuration file could look like:
# Sample configuration file for lintian # # Set the default profile (--profile) LINTIAN_PROFILE = debian # Set the default TMPDIR for lintian to /var/tmp/lintian # - useful if /tmp is tmpfs with "limited" size. TMPDIR = /var/tmp/lintian/ # Show info (I:) tags by default (--display-info) # NB: this cannot be used with display-level display-info=yes # Ignore all overrides (--no-override) # NB: called "override" in the config file # and has inverted value! override = no # Automatically determine if color should be used color = auto
A lab query can be used to refer to a (set of) package(s) in the Lintian Laboratory. The general format of a query is:
[type:]package[/version[/arch]]
Where:
If omitted this defaults to "ALL". The pseudo type "ALL" acts as a wildcard for any real package type.
The special type "GROUP" can be used to match all packages related to a given source package. For more info, please see "Group query" below.
Note: This is completely ignored when matching against source packages or when type is "GROUP".
Note: For changes packages, this must match the contents of the architecture field in the changes. This field may contain a space (e.g. "source all") and therefore may also need proper shell escape.
A group query can be used to (re-)process all packages in a given group. The package and version part will be used to look up one or more source packages. The binaries, udebs and changes files for each matching source package will also be activated.
When run in an unpacked package dir (with no package selection arguments), Lintian will use debian/changelog to determine the source and version of the package. Lintian will then attempt to find a matching .changes file for this source and version combination.
Lintian will (in order) search the following directories:
In each directory, Lintian will attempt to find a .changes file using the following values as architecture (in order):
If a .changes file matches any combination above exists, Lintian will process the first match as if you had passed it per command line. If no .changes file can be found, Lintian will print a list of attempted locations on STDERR and exit 0.
Lintian does not have any locking mechanisms yet. (Running several Lintian processes on the same laboratory simultaneously is likely to fail or corrupt the laboratory.)
If you discover any other bugs in lintian, please contact the authors.
lintian-info(1), Lintian User Manual (file:/usr/share/doc/lintian/lintian.html/index.html), lintian-lab-tool(1)
Packaging tools: debhelper(7), dh_make(8), dpkg-buildpackage(1).
Niels Thykier <niels@thykier.net>
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.