dh_lintian - Linux
Overview
dh_lintian is a command-line tool used in Debian packaging to check the quality of Debian source packages. It runs Lintian, a linter for Debian packages, and helps identify potential issues or problems with the package.
Syntax
dh_lintian [options]
Options/Flags
- -b, –build: Build the package before running Lintian.
- -f, –format=FORMAT: Output format (defaults to "plain").
- -g, –gpg-check: Check GPG signatures of the package.
- -h, –help: Display usage information.
- -n, –no-check: Don’t build or check the package.
- -p, –pedantic: Use stricter checking rules.
- -q, –quiet: Suppress output.
- -v, –verbose: Enable verbose output.
- -w, –warnings-as-errors: Treat warnings as errors.
- –show-details: Show details of each check.
- –show-tags: Show the tags associated with each check.
Examples
Simple usage:
dh_lintian
Build the package and check with pedantic rules:
dh_lintian -bp
Check the package without building it:
dh_lintian -n
Common Issues
- Missing dependencies: Ensure all dependencies required by the package are installed.
- Incorrect version numbers: Verify that version numbers in the package control file match the actual package contents.
- Unsigned source packages: Sign source packages before uploading them to a repository.
Integration
Combine with dpkg-buildpackage:
dpkg-buildpackage -us -uc | dh_lintian -
Use in a Git pre-commit hook:
git config --local hooks.pre-commit "./debian/hooks/pre-commit"
Related Commands
- lintian: Debian package linter
- dh: Debian helper program
- dpkg-buildpackage: Debian package builder