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