PKGLINT(1)

NAME
pkglint - static analyzer for pkgsrc packages

SYNOPSIS
pkglint [-options] [dir ...]

DESCRIPTION
pkglint attempts to detect features of the named pkgsrc packages that are likely to be bugs, or that are simply deprecated.

  Options

-C{[no-]check,...}
    Enable or disable specific checks. For a list of checks, see below.

-D{[no-]debug,...}
    Enable or disable debugging categories. For a list of categories, see below.

-I  Show the Makefile that is constructed by including all the files that are slurped in via ‘.include’ directives. This flag is mainly for debugging.

-R|--rcsidstring
    Allow other RCS Id strings than NetBSD. Multiple strings may be concatenated with ‘|’.

-V|--version
    Print the current pkglint version number and exit.

-W{[no-]warn,...}
    Enable or disable specific warnings. For a list of warnings, see below.

-e|--explain
    Print further explanations for diagnostics. Sometimes the reasons for diagnostics are not obvious and need further explanation.

-g|--gcc-output-format
    Use a format for the diagnostics that is understood by most programs, especially editors, so they can provide a point-and-goto interface.

-h|--help
    Show the summary of command line options, then exit.

-i|--import
    Check if a package is ready to be imported into pkgsrc. This is especially useful for packages from the pkgsrc-wip project.

-q|--quiet
    Don't print the errors and warnings summary before terminating.

-r|--recursive
    Check subdirectories, too. The subdirectories are those that are mentioned in a ‘SUBDIR+=’ line.

-s|--source
    For all diagnostics having file and line number information, show the source code along with the diagnostics.

  Checks

all Enable all checks.

none
    Disable all checks.

[no-]ALTERNATIVES
    Check the alternatives file.

[no-]DESCR
    Check the DESCR file.

[no-]INSTALL
    Check the INSTALL and DEINSTALL scripts.

[no-]Makefile
    Check the package Makefile, including all included files.

[no-]MESSAGE
    Check MESSAGE files.

[no-]PLIST
    Check PLIST files.

[no-]bl3
    Check buildlink3 Makefiles.

[no-]distinfo
    Check the distinfo file.

[no-]extra
    Check remaining files in the package directory.

[no-]mk
    Check Makefile fragments besides buildlink3.

[no-]patches
    Check the pkgsrc specific patch files.

  Debugging Options

all Enable all debugging options.

none
    Disable all debugging options.

[no-]include
    Show the pathnames of the included Makefiles.

[no-]misc
    Some debugging stuff that hasn't made it into its own category.

[no-]patches
    Print the states of the patch file parser.

[no-]quoting
    Additional information about why variables should be quoted or not.

[no-]shell
    Parser information from the shell word and the shell command parsers.

[no-]tools
    Additional information about the tools from the tools framework.

[no-]trace
    Print the names of subroutines and their arguments as they are entered.

[no-]unchecked
    Show the things that pkglint cannot currently check. These are mostly due to unresolved make variables.

[no-]unused
    Show which variables are detected as used, and so will not generate an “unused variable” warning.

[no-]vartypes
    Additional information about the variable types.

[no-]varuse
    Information about the contexts in which variables are used.

  Warnings

all Enable all warnings.

none
    Disable all warnings.

[no-]directcmd
    Warn if a system command name is used instead of a variable (e.g. sed instead of ${SED}).

[no-]extra
    Emit some additional warnings that are not enabled by default, for whatever reason.

[no-]order
    Warn if Makefile variables are not in the preferred order.

[no-]plist-depr
    Warn if deprecated pathnames are used in PLIST files. This warning is disabled by default.

[no-]plist-sort
    Warn if items of a PLIST file are not sorted alphabetically. This warning is disabled by default.

[no-]quoting
    Warn for possibly invalid quoting of make variables in shell programs and shell variables themselves.

[no-]space
    Emit notes for inconsistent use of white-space.

[no-]style
    Warn for stylistic issues that don't affect the build process.

[no-]types
    Warn for some Makefile variables if their assigned values do not match their type.

[no-]varorder
    Warn if the variables in a package Makefile s are not ordered in the way it is described the pkgsrc guide.

  Other arguments

dir ...
    The pkgsrc directories to be checked. If omitted, the current directory is checked.

FILES
pkgsrc/mk/*
    Files from the pkgsrc infrastructure.

EXAMPLES

pkglint -Cnone,patches.
    Checks the patches of the package in the current directory.

pkglint -Wall /usr/pkgsrc/devel
    Checks the category Makefile and reports any warnings it can find.

pkglint -r -R 'NetBSD|Id' /usr/pkgsrc
    Check the whole pkgsrc tree while allowing ‘NetBSD’ or ‘Id’ as the RCS Id.

DIAGNOSTICS
Diagnostics are written to the standard output.

ERROR: ...
    Errors should be fixed before a package is committed to pkgsrc.

WARN: ...
    Warnings generally should be fixed, but they are not as critical as errors.

AUTHORS
Roland Illig <rillig@NetBSD.org>

BUGS
Many more checks could be added.

If you don't understand the messages, feel free to ask on the <tech-pkg@NetBSD.org> mailing list.