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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
|
.\" $OpenBSD: pkg_info.1,v 1.56 2017/02/27 21:53:11 rpe Exp $
.\"
.\" Documentation and design originally from FreeBSD. All the code has
.\" been rewritten since. We keep the documentation's notice:
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" Jordan K. Hubbard
.\"
.\"
.Dd $Mdocdate: February 27 2017 $
.Dt PKG_INFO 1
.Os
.Sh NAME
.Nm pkg_info
.Nd display information on software packages
.Sh SYNOPSIS
.Nm pkg_info
.Bk -words
.Op Fl AaCcdfIKLMmPqRSstUvz
.Op Fl E Ar filename
.Op Fl e Ar pkg-name
.Op Fl l Ar str
.Op Fl Q Ar query
.Op Fl r Ar pkgspec
.Op Ar pkg-name ...
.Ek
.Sh DESCRIPTION
The
.Nm
command is used to dump out information for packages, as created by
.Xr pkg_create 1 ,
which may be still
packed up or already installed on the system with the
.Xr pkg_add 1
command.
.Pp
The
.Ar pkg-name
may be the name of an installed package, the pathname to a package
distribution file, or a URL to a package available through FTP, HTTP, HTTPS,
or SCP.
.Nm
will try to complete
.Ar pkg-name
with a version number while looking through installed packages.
.Pp
When browsing through uninstalled packages, running
.Ic pkg_info -I *.tgz
will report a summary line for each package, so that it is possible to
run
.Ic pkg_info pkgname.tgz
to obtain a longer package description, and
.Ic pkg_add -n pkgname.tgz
to check that the installation would proceed cleanly, including dependencies.
.Pp
The following command-line options are supported:
.Bl -tag -width indent
.It Fl A
Show information for all currently installed packages,
including internal packages.
.It Fl a
Show information for all currently installed packages.
.It Fl C
Show certificate information for signed packages.
.It Fl c
Show the one-line comment field for each package.
.It Fl d
Show the long-description field for each package.
.It Fl E Ar filename
Look for the package(s) that contains the given
.Ar filename .
As a faster alternative, note that there is a package, pkglocatedb, that
contains a
.Xr locate 1
database of every file in every package.
.It Fl e Ar pkg-name
This option
allows you to test for the presence of another (perhaps
prerequisite) package from a script.
If the package identified by
.Ar pkg-name
is currently installed, return 0, otherwise return 1.
In addition, the names of any package(s) found installed are printed to
stdout unless turned off using the
.Fl q
option.
.Pp
The given
.Ar pkg-name
is actually a package specification, as described in
.Xr packages-specs 7 .
For example,
.Ic pkg_info -e 'name->=1.3'
will match versions 1.3 and later of the
.Pa name
package.
.It Fl e Ar pkgpath
Another variant of this option that uses a pkgpath instead.
A pkgpath is a location within the ports tree, as described
in
.Xr pkgpath 7 .
For example,
.Ic pkg_info -e x11/kde/base3
will match any package that was compiled according to
.Pa ${PORTSDIR}/x11/kde/base3 .
.It Fl f
Show the packing-list instructions for each package.
See
.Xr pkg_create 1
and
.Xr package 5
for the various annotations.
.It Fl I
Show the index entry for each package.
.It Fl K
Prefix file names with category keyword (e.g., @file, @lib).
Always used together with
.Fl L .
.It Fl L
Show the files within each package.
This is different from just
viewing the packing-list, since full pathnames for everything
are generated.
.It Fl l Ar str
Prefix each information category header (see
.Fl q )
shown with
.Ar str .
This is primarily of use to front-end programs that want to request a
lot of different information fields at once for a package, but don't
necessarily want the output intermingled in such a way that they can't
organize it.
This lets you add a special token to the start of each field.
.It Fl M
Show the install-message file (if any) for each package.
.It Fl m
Only show packages tagged as manual installations.
It should omit anything
installed automatically as a dependency.
.It Fl P
Show the
.Xr pkgpath 7
for each package.
You can easily build a subdirlist with this.
.It Fl Q Ar query
Show all packages in $PKG_PATH which match the given
.Ar query .
.It Fl q
Be
.Dq quiet
in emitting report headers and such, just dump the
raw info (basically, assume a non-human reading).
.It Fl R
Show which packages require a given package.
.It Fl r Ar pkgspec
Check a list for a given
.Ar pkgspec .
The following arguments are names of packages to verify.
Exit status will be augmented by 2 if none of the packages do match.
.It Fl S
Show the update signature for each package.
The
.Sq update signature
is a unique tag showing the package name, and the version number
of every run time dependency and shared library used to build this package.
.It Fl s
Show an estimate of the total size of each package.
.It Fl t
Show packages which are not required by any other packages.
.It Fl U
Show the deinstall-message file (if any) for each package.
.It Fl v
Turn on verbose output.
.It Fl z
Fuzzy listing option, often used together with
.Fl m .
Only shows stems, flavors and branches information.
To be reused with
.Xr pkg_add 1
.Fl l
to recreate a package installation with different versions and no ambiguity.
Note that this intentionally does not include firmware, as they are not
handled by
.Xr pkg_add 1 .
.El
.Sh ENVIRONMENT
.Bl -tag -width PKG_TMPDIR
.It Ev PKG_DBDIR
The standard package database directory,
.Pa /var/db/pkg ,
can be overridden by specifying an alternative directory in the
.Ev PKG_DBDIR
environment variable.
.It Ev PKG_PATH
This can be used to specify a colon-separated list of paths to search for
package files.
The current directory is always searched first, even if
.Ev PKG_PATH
is set.
If
.Ev PKG_PATH
is used, the suffix
.Dq .tgz
is automatically appended to the
.Ar pkg-name ,
whereas searching in the current directory uses
.Ar pkg-name
literally.
.It Ev PKG_TMPDIR
Temporary area where package information files will be extracted, instead of
.Pa /var/tmp .
.El
.Sh TECHNICAL DETAILS
Package info is either extracted from package files named on the
command line, or from already installed package information
in
.Pa /var/db/pkg/<pkg-name> .
.Sh SEE ALSO
.Xr pkg_add 1 ,
.Xr pkg_create 1 ,
.Xr pkg_delete 1 ,
.Xr bsd.port.mk 5 ,
.Xr package 5 ,
.Xr packages-specs 7 ,
.Xr pkgpath 7
.Sh AUTHORS
.Bl -tag -width indent -compact
.It An Jordan Hubbard
initial design
.It An Marc Espie
complete rewrite
.El
|