summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install/files/info/pkg_info.1
blob: ce24ee847b65c60648ad1361f2bee0550fd1203f (plain)
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
.\" $NetBSD: pkg_info.1,v 1.5 2003/12/08 13:50:50 grant Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
.\"
.\" 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
.\"
.\"
.\"     @(#)pkg_info.1
.\"
.Dd September 2, 2003
.Dt PKG_INFO 1
.Os
.Sh NAME
.Nm pkg_info
.Nd a utility for displaying information on software packages
.Sh SYNOPSIS
.Nm
.Op Fl BbcDdFfhIikLmNnpqRrSsVv
.Bk -words
.Op Fl e Ar package
.Ek
.Bk -words
.Op Fl K Ar pkg_dbdir
.Ek
.Bk -words
.Op Fl l Ar prefix
.Ek
.Ar pkg-name ...
.Nm
.Bk -words
.Op Fl a Ar flags
.Ek
.Sh DESCRIPTION
The
.Nm
command is used to dump out information for packages, which may be either
packed up in files or already installed on the system with the
.Xr pkg_create 1
command.
.Pp
The
.Ar pkg-name
may be the name of an installed package (with our without version), a
pattern matching several installed packages (see the
.Fl e
switch for a description of possible patterns),
the pathname to a
package distribution file, a filename belonging to an installed
package (if
.Fl F
is also given), or a URL to an ftp-available package.
.Pp
The following command-line options are supported:
.Bl -tag -width indent
.It Fl a
Show information for all currently installed packages.
.It Fl B
Show some of the important definitions used when building
the binary package (the "Build information") for each package.
.It Fl b
Show the
.Nx
RCS Id strings from the files used in the construction
of the binary package (the "Build version") for each package.
These files are the package Makefile, any patch files, any checksum
files, and the packing list file.
.It Fl c
Show the one-line comment field for each package.
.It Fl D
Show the install-message file (if any) for each package.
.It Fl d
Show the long-description field for each 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
If the given
.Ar pkg-name
contains a
shell meta character, it will be matched against all installed
packages using
.Xr fnmatch 3 .
.Xr csh 1
style {,} alternates have also been implemented in addition to this.
Package version numbers can also be matched in a relational manner
using the
.Pa \*[Ge], \*[Le], \*[Gt]
and
.Pa \*[Lt]
operators.
For example,
.Pa pkg_info -e 'name\*[Ge]1.3'
will match versions 1.3 and later of the
.Pa name
package.
The collating sequence of the various package version numbers is
unusual, but strives to be consistent.
The magic string ``alpha'' equates to
.Pa alpha version
and sorts before a beta version.
The magic string ``beta'' equates to
.Pa beta version
and sorts before a release candidate.
The magic string ``rc'' equates to
.Pa release candidate
and sorts before a release.
For example,
.Pa name-1.3rc3
will sort before
.Pa name-1.3
and after
.Pa name-1.2.9
Similarly
.Pa name-1.3alpha2
will sort before
.Pa name-1.3beta1
and they both sort before
.Pa name-1.3rc1
In addition, alphabetic characters sort in the same place as
their numeric counterparts, so that
.Pa name-1.2e
has the same sorting value as
.Pa name-1.2.5
The magic string ``pl'' equates to a
.Pa patch level
and has the same value as a dot in the dewey-decimal ordering schemes.
.It Fl F
Interpret any pkg-name given as filename, and translate it to a
package name using the Package Database.
This can be used to query information on a per-file basis, e.g. in
conjunction with the
.Fl e
flag to find out which package a file belongs to.
.It Fl f
Show the packing list instructions for each package.
.It Fl I
Show the index entry for each package.
.It Fl i
Show the install script (if any) for each package.
.It Fl K Ar pkg_dbdir
Set
.Ar pkg_dbdir
as the package database directory.
If this option isn't specified, then the package database directory is
taken from the value of the environment variable
.Ev PKG_DBDIR
if it's set, otherwise it defaults to
.Pa /var/db/pkg .
.It Fl k
Show the de-install script (if any) for each package.
.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
necessary 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 mtree file (if any) for each package.
.It Fl N
Show which packages each package was built with (exact dependencies), if any.
.It Fl n
Show which packages each package needs (depends upon), if any.
.It Fl p
Show the installation prefix for each package.
.It Fl q
Be ``quiet'' in emitting report headers and such, just dump the
raw info (basically, assume a non-human reading).
.It Fl R
Show which packages are required by each package.
.It Fl r
Show the requirements script (if any) for each package.
.It Fl S
Show the size of this package and all the packages it requires,
in bytes.
.It Fl s
Show the size of this package in bytes.
The size is calculated by adding up the size of each file of the package.
.It Fl V
Print version number and exit.
.It Fl v
Turn on verbose output.
.El
.Sh ENVIRONMENT
.Bl -tag -width PKG_DBDIR
.It Ev PKG_DBDIR
If the
.Fl K
flag isn't given, then
.Ev PKG_DBDIR
is the location of the package database directory.
The default package database directory is
.Pa /var/db/pkg .
.It Ev PKG_PATH
This can be used to specify a semicolon-separated list of paths and URLs to search for
package files.
If
.Ev PKG_PATH
is used, the suffix
.Pa .tgz
is automatically appended to the
.Ar pkg-name ,
whereas searching in the current directory uses
.Ar pkg-name
literally.
.It Ev PKG_TMPDIR , Ev TMPDIR
These are tried in turn (if set) as candidate directories in which
to create a ``staging area'' for any files extracted by
.Nm
from package files.
If neither
.Ev PKG_TMPDIR
nor
.Ev TMPDIR
yields a suitable scratch directory,
.Pa /var/tmp ,
.Pa /tmp ,
and
.Pa /usr/tmp
are tried in turn.
Note that
.Pa /usr/tmp
may be created, if it doesn't already exist.
.Pp
Since
.Nm
requires very little information to be extracted from any package
files examined, it is unlikely that these environment variables would
ever need to be used to work around limited available space in the
default locations.
.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/\*[Lt]pkg-name\*[Gt] .
.Pp
A filename can be given instead of a (installed) package name to query
information on the package this file belongs to.
This filename is then resolved to a package name using the Package Database.
For this translation to take place, the
.Fl F
flag must be given.
The filename must be absolute, compare the output of pkg_info
.Fl aF .
.Sh SEE ALSO
.Xr pkg_add 1 ,
.Xr pkg_admin 1 ,
.Xr pkg_create 1 ,
.Xr pkg_delete 1 ,
.Xr mktemp 3 ,
.Xr packages 7 ,
.Xr mtree 8
.Sh AUTHORS
.Bl -tag -width indent -compact
.It "Jordan Hubbard"
most of the work
.It "John Kohl"
refined it for
.Nx
.It "Hubert Feyrer"
.Nx
wildcard dependency processing, pkgdb, depends displaying,
pkg size display etc.
.El