prtcheck(1)

NAME
prtcheck - check the port in the current directory

SYNOPSIS

prtcheck [ --root ]

DESCRIPTION
The prtcheck script checks the following things: existence of Pkgfile, .footprint and .signature. It warns, if non-root users are found in the .footprint or if empty fields are found for Description, URL, Maintainer, and "Depends on". It also detects if any of the source files distributed with the port do not appear in .signature. If any element of a correct port is missing, prtcheck exits with 1.

OPTIONS
The only supported option is --root, which is a convenient way to fix the footprint generated by running pkgmk(8) as a non-root user. The non-root user having no write access outside $HOME can safely build a port to see whether the Makefile respects DESTDIR. But the resulting .footprint then has uid/gid entries corresponding to the user who called pkgmk (unless you run pkgmk under fakeroot(1), or edit the bsdtar commands inside pkgmk itself to add the flags --uid 0 --gid 0). If you prefer to keep the default bsdtar flags and not install fakeroot, then you can follow up the build as a non-root user with prtcheck --root, which replaces your uid/gid entries with root/root.

COMPARISON WITH OTHER UTILITIES
prtcheck assumes that $PWD is the port's directory, does not accept any non-option arguments, and conducts all its tests by reading Pkgfile(5) and .signature from the current directory.

prtverify(1) only cares about $PWD if you pass relative paths as arguments. It will happily accept absolute pathnames instead. In either case, at least one non-option argument passed to prtverify(1) must resolve to a directory; otherwise no tests are conducted.

For the test of whether .signature is complete, prtcheck needs to source the Pkgfile(5). Once this step is allowed, it would be natural to test whether the other mandatory variables name, version, release are defined. In its original design, such tests were omitted, and the gap was later filled by prtverify(1). But the gawk modules of prtverify(1) might return false positives, for example if the maintainer defines the name variable as part of a compound command like:

    /bin/true && name=myport

Replacing the usual name definition with the line above yields a Pkgfile(5) perfectly acceptable to pkgmk(8), but not to prtverify(1). It would be straightforward to incorporate into prtcheck a more robust test of these mandatory variables, but in the absence of any real-world examples of maintainer deviousness like the line above, there is no compelling reason to duplicate the prtverify(1) tests, which in their present form achieve at least 99% accuracy.

AUTHORS
prtcheck was written by Martin Opel in 2003, and extended by John McQuah in 2022 to test whether every item in the source array has a corresponding line in .signature (addressing FS#1763).

SEE ALSO
prtverify(1)