1.\" $OpenBSD: portcheck.1,v 1.2 2019/05/29 19:37:06 fcambus Exp $ 2.\" 3.\" Copyright (c) 2013 Vadim Zhukov 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: May 29 2019 $ 18.Dt PORTCHECK 1 19.Os 20.Sh NAME 21.Nm portcheck 22.Nd validate a port before submitting 23.Sh SYNOPSIS 24.Nm 25.Op Fl dNP 26.Op Fl p Ar portsdir 27.Op Fl x Ar pattern 28.Pp 29.Nm 30.Fl A 31.Op Fl dP 32.Op Fl p Ar portsdir 33.Op Fl x Ar pattern 34.Op Ar subdir ... 35.Sh DESCRIPTION 36.Nm 37is used to validate the 38.Ox 39port or port hierarchy in current directory. 40It should be used before submitting ports for review to avoid making 41common mistakes. 42.Nm 43verifies that directory and file structure for a port is in place and 44that no bogus files exist. 45.Pp 46When it's done, 47.Nm 48will print detected value of port's 49.Ev PKGPATH 50to standard output, unless it fails in detection. 51In the latter case, the 52.Fl p 53option should be provided. 54All other (error) messages from 55.Nm 56end up on standard error output. 57.Pp 58By default, 59.Nm 60automatically picks up nearest parent directory named 61.Dq ports , 62with an optional 63.Dq mystuff 64or 65.Dq openbsd-wip 66subdirectory component, as the ports root directory. 67For example: if the port being imported is located in 68.Pa /home/joe/cvs/ports/openbsd-wip/devel/p5-Foo , 69then the root ports directory will be detected as being 70.Pa /home/joe/cvs/ports/openbsd-wip . 71To override this behaviour, see the 72.Fl p 73option. 74.Pp 75The following options are available: 76.Bl -tag -width Ds 77.It Fl A 78Intended for running 79.Nm 80on the whole ports tree, i.e., the one lying in 81.Ev PORTSDIR . 82This option adds several ignore patterns (see 83.Fl x 84option description) and disables some other checks (e.g., for missing 85distinfo). 86.Ev PKGPATH 87determining and printing won't be done. 88Implicit change of working directory to the ports tree root is done 89before starting any checks. 90Also, in this mode one or more 91.Ar subdir 92arguments could be specified, to narrow the check only for given 93subdirectories of ports tree root. 94.It Fl d 95Show debugging information such as calling of check routines. 96.It Fl P 97Disable expensive checks that use 98.Dq print-plist-with-depends 99target, e.g., proper usage of 100.Xr gtk-update-icon-cache 1 , 101.Xr update-desktop-database 1 102and 103.Xr update-mime-database 1 . 104.It Fl p Ar portsdir 105Forces the given directory to be treated as ports root directory. 106Cancels autodetection of the root ports directory made by default. 107This option is useful, e.g., when you have a temporary ports tree in 108a non-standard location. 109.It Fl N 110Intended to be used when working on new ports. 111Enables the checks like the presence of REVISION markers and non-0.0 112.Ev SHARED_LIBS . 113It also enables checks for the presence of CVS directories that could 114be left by mistake when creating a new port based on another one. 115.It Fl x 116Excludes files and subdirectories matching given shell globbing pattern 117from any checks. 118Note that matching is done against relative path, and not against 119absolute path or base name either. 120I.e., to exclude the 121.Dq x11/kde4/libs/logs 122from checks, you must pass the whole line as argument, not just 123.Dq logs . 124Multiple -x options may be specified. 125.El 126.Sh EXAMPLES 127To validate a new port you've just prepared, go to port's directory and 128run: 129.Bd -literal -offset indent 130$ portcheck -N 131.Ed 132.Pp 133If you were working on updating of an existing port in CVS tree: 134.Bd -literal -offset indent 135$ portcheck 136.Ed 137.Pp 138To run a global check of the whole 139.Dq devel 140category in ports tree, use the 141.Fl A 142option instead: 143.Bd -literal -offset indent 144$ portcheck -Ap /usr/ports devel 145.Ed 146.Sh SEE ALSO 147.Xr portimport 1 148.Sh HISTORY 149This utility was split from 150.Xr portimport 1 151in 2013 and first appeared in 152.Ox 5.5 . 153