LINTPKGSRC(1)

NAME
lintpkgsrc - verifier for the pkgsrc tree

SYNOPSIS
lintpkgsrc [-BDdLlmOopRrSuyz] [-E file] [-g pkgsrcmap] [-I file] [-K PACKAGES] [-M DISTDIR] [-P PKGSRCDIR] [makefile ...]

DESCRIPTION
lintpkgsrc tries to verify the entire contents of the pkgsrc tree. lintpkgsrc uses simple regular-expression matching for verifying files that make up a pkgsrc directory. Note that it does NOT implement a complete Makefile parser.

  Options

-B  List packages marked as BROKEN.

-D paths
    Parse Makefiles and output contents (useful for debugging).

-d  Extract the ‘DEPENDS’ listing from each pkgsrc package Makefile, then verify the version specified in each DEPEND correctly matches a current pkgsrc package.

-E file
    Exports the internal database generated from the pkgsrc Makefiles to a file for faster loading at a later time. Note that some of the stored data is, in all likelihood, dependent on the architecture and operating system of the machine where it is generated. However, the database does make the task of, eg, checking for out of date packages on a set of similarly configured machines (in the absence of extra copies of the pkgsrc tree) both quick and possible.

-g pkgsrcmap
    Generate pkgsrcmap file containing an entry for each package of ‘pkgname pkgdir pkgver’.

-h  Basic help and usage.

-I file
    Imports the data to construct the internal database for checking the installed versions of packages, among other things, against the current version found in pkgsrc. This database provides most or all of the data required for running lintpkgsrc with any combination of -B, -O, -R, -S, -d, -g, -i, -p, or -u.

-i  Check the version of each installed package against the current version in pkgsrc.

-K PACKAGES
    Override binary packages base directory, normally set from /etc/mk.conf or defaulted to ${PKGSRCDIR}/packages.

    Note: lintpkgsrc treats PACKAGES slightly differently to the pkgsrc build system. -p and -R check for binary packages in any depth of PACKAGES subdirs - this allows packages for all architectures/OS versions to be checked simultaneously with an /etc/mk.conf construct of the form:

        .ifdef LINTPKGSRC
        PACKAGES=${PKGSRCDIR}/packages
        .else
        PACKAGES=${PKGSRCDIR}/packages/${OS_VERSION}/${MACHINE_ARCH}
        .endif

    Which would be an alternative to -K.

-L  List the filenames of Makefiles as they are parsed (for debugging).

-M DISTDIR
    Set directory for distfiles, defaults to ${PKGSRCDIR}/distfiles.

-m  For each current distfile, verify its checksum against the appropriate package's distinfo file. Also report if any package's distinfo file references the same distfile with a different distinfo checksum.

-O  Report any binary packages in any subdirs of PACKAGES, for whom the source Makefile lists OSVERSION_SPECIFIC. This is intended to help those making binary packages available for ftp.

-o  Report any old distfiles (not referenced by any package's distinfo file).

-P PKGSRCDIR
    Set base of pkgsrc tree, normally set from /etc/mk.conf or defaulted to /usr/pkgsrc.

-p  Report any old binary packages in any subdirs of PACKAGES.

-R  Report any binary packages in any subdirs of PACKAGES, for whom the source Makefile lists NO_BIN_ON_FTP or RESTRICTED. This is intended to help those making binary packages available for ftp.

-r  Remove distfiles which are not referenced from any package's distinfo file, or have an incorrect checksum (usually due to an interrupted download), and any old binary packages. To remove any given type, additionally specify the -o, -m, or -p flags respectively.

-S  List packages missing from category SUBDIR lists.

-u  As -i plus for mismatched packages, display REQUIRED details and run ‘/usr/bin/make fetch-list | sh’ to ensure all the distfiles needed for the latest version are present.

    Warning: The behaviour of this command may change in a later version.

-y  Remove orphaned distfiles, i.e., those that do not belong to any currently installed package.

-z  Remove distfiles for currently installed packages.

AUTHORS
David Brownlee <abs@netbsd.org>

BUGS
The -R and -p options default to using PACKAGES as the base directory from which to search for binary packages. If this includes OS or architecture information then packages for other OS/architecture combinations will be missed. In this case PACKAGES can be overridden with -K or set conditionally in /etc/mk.conf based on the value of LINTPKGSRC.

The ‘Makefile parsing’ algorithm used to obtain package versions and DEPENDS information is geared towards speed rather than perfection, though it has got somewhat better over time, it only parses the simplest Makefile conditionals. (a == b, no etc).

Potentially others, but non serious to date.