forked from freebsd/pkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkg-search.8
499 lines (499 loc) · 13.2 KB
/
pkg-search.8
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
.\"
.\" FreeBSD pkg - a next generation 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.
.\"
.\"
.\" @(#)pkg.8
.\"
.Dd November 18, 2014
.Dt PKG-SEARCH 8
.Os
.Sh NAME
.Nm "pkg search"
.Nd search package repository catalogues
.Sh SYNOPSIS
.Nm
.Op Fl U
.Op Fl r Ar reponame
.Op Fl S Ar search
.Op Fl L Ar label
.Op Fl Q Ar query-modifier
.Op Fl Cegix
.Ar pattern
.Nm
.Op Fl cDdfopqRsU
.Op Fl r Ar reponame
.Op Fl Cegix
.Ar pattern
.Pp
.Nm
.Op Cm --no-repo-update
.Op Cm --repository Ar reponame
.Op Cm --search Ar search
.Op Cm --label Ar label
.Op Cm --query-modifier Ar query-modifier
.Op Cm --{case-sensitive,exact,glob,case-insensitive,regex}
.Ar pattern
.Nm
.Op Cm --{comment,description,depends-on,full,origins,prefix}
.Op Cm --{quiet,raw,size,no-repo-update}
.Op Cm --repository Ar reponame
.Op Cm --{case-sensitive,exact,glob,case-insensitive,regex}
.Op Fl -raw-format Ar format
.Ar pattern
.Sh DESCRIPTION
.Nm
is used for searching package repository catalogues.
Packages available for installation can be matched by name, by name
and version, by origin, or by text in the package comments or package
descriptions.
The output defaults to displaying the field matched by the search
term, but any of the searchable fields may be displayed.
The output may be modified to additionally show many other package
data available from the repository catalogues.
.Pp
Package repository catalogues will be automatically updated whenever
.Nm
is run by a user ID with write access to the package database,
unless disabled by the
.Fl U
flag or setting
.Cm REPO_AUTOUPDATE
to
.Sy NO
in
.Xr pkg.conf 5 .
.Pp
Package repositories are defined in the
.Fa pkg.conf
file or by creating repository definitions in
.Pa /usr/local/etc/pkg/repos.
See
.Xr pkg.conf 5
for details.
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width repository
.It Fl C , Cm --case-sensitive
Make the exact
.Fl ( e )
or the regular expression
.Fl ( x )
matching against
.Ar pkg-name
case sensitive.
.It Fl c , Cm --comment
Search for packages with comment text matching
.Ar pattern .
Equivalent to
.Fl "S comment" .
.It Fl D , Cm --description
Search for packages with description text matching
.Ar pattern .
Equivalent to
.Fl "S description" .
.It Fl d , Cm --depends-on
Display the list of packages depended on by each matched package.
Equivalent to
.Fl "Q depends-on" .
.It Fl e , Cm --exact
.Ar pattern
should be an exact match against the search field.
.It Fl f , Cm --full
Show ``full'' information about the package.
Equivalent to
.Fl "Q full" .
.It Fl g , Cm --glob
Treat
.Ar pattern
as a shell globbing expression.
The glob pattern must match the entire field being searched.
.It Fl i , Cm --case-insensitive
Make the exact
.Fl ( e )
or regular expression
.Fl ( x )
matching against
.Ar pattern
case insensitive.
This is the default, unless modified by setting
.Ev CASE_SENSITIVE_MATCH
to true in
.Pa pkg.conf .
.It Fl L Ar label , Cm --label Ar label
Select which identifying label is printed for each matched package,
unless
.Fl q
is used.
Several different fields from the repository catalogue database may be
used to search on, or to generate the label, as indicated by the
.Ar label
argument.
See the
.Qq Sx Search and Label Options
section for details.
If unspecified,
.Ar label
is set to the same as the value searched via the
.Fl S Ar search
option.
.It Fl o , Cm --origins
List packages by origin for each package matching
.Ar pattern .
Equivalent to
.Fl "L origin" .
.It Fl p , Cm --prefix
Display the package installation prefix for each matched package.
Equivalent to
.Fl "Q prefix" .
.It Fl q , Cm --quiet
Be
.Dq quiet .
Produce less output.
In particular do not show an identifying label field for each package.
.It Fl Q Ar query-modifier , Cm --query-modifier Ar query-modifier
Modify the query output by adding an additional field to the result.
Multiple fields can be added by using additional
.Fl Q Ar query-modifier
flags.
See the
.Qq Sx Output Modifier Options
section for details.
.It Fl r Ar reponame , Cm --repository Ar reponame
Search for packages from only the named repository,
irrespective of the configured
.Dq active
status from
.Pa repo.conf .
By default all repository catalogues marked
.Dq active
are searched.
.It Fl R , Fl -raw
Display the full manifest (raw) from the matching packages.
.It Fl S Ar search , Cm --search Ar search
Specify the field to search the repository catalogue on.
If unspecified, searches on
.Ar pkg-name
unless the search term contains a
.Sy /
character, when it searches on port
.Ar origin .
Output will be sorted in order of the
.Ar search
field.
See the
.Qq Sx Search and Label Options
sections for more details.
.It Fl -raw-format Ar format
Choose the format of the raw output.
The format can be:
json, json-conpact, yaml (default).
.It Fl s , Cm --size
Display the installed size of matched packages.
Equivalent to
.Fl "Q size" .
.It Fl U, Cm --no-repo-update
Suppress the automatic update of the local copy of the repository catalogue
from remote.
Automatic repository catalogue updates are only attempted when the
effective UID of the process has write access to the package database.
Otherwise they are silently ignored.
.It Fl x , Cm --regex
Treat
.Ar pattern
as a regular expression according to the "modern" or "extended"
syntax of
.Xr re_format 7 .
This is the default.
Matches any substring of the search field unless explicit beginning
or ending anchor terms are used.
.El
.Ss Search and Label Options
The following database fields (or composites of several fields) can
be used both for searching for a match to the given
.Ar pattern
and as identifying labels for the block of output for each package.
.Bl -tag -width 2n
.It Sy comment
The one line comment field describing the port, derived from the
.Cm COMMENT
variable in the port's
.Fa Makefile .
When chosen as a label option, the output format will additionally
include the package name, equivalent to
.Fl "L pkg-name"
.Fl "Q comment" .
When chosen as a search option, only the
.Sy comment
field is used for sorting the output.
.It Sy description
The multi-line package description from the
.Fa pkg-descr
file in the port.
This does include the
.Cm WWW
URL reference, if any, from that file.
When chosen as a label option, the output format will additionally
include the package name, equivalent to
.Fl "L pkg-name"
.Fl "Q description" .
When chosen as a search option, only the
.Sy description
field is used for sorting the output.
.It Sy name
The name of the package, derived from the
.Cm PORTNAME
variable in the port's
.Fa Makefile .
.It Sy origin
The port origin, in the format
.Fa category/port ,
that the package was compiled from.
.It Sy pkg-name
The package name in the format
.Sy name Ns - Ns Cm version .
The same as the
.Cm PKGNAME
variable in the port's
.Fa Makefile .
.El
.Pp
Any unambiguous prefix of the label name may be used on the command line.
Thus
.Fl "Sd" ,
.Fl "S descr"
and
.Fl "S description"
are all equivalent.
.Ss Output Modifier Options
Additional data from the repository catalogue to print for each matched
package.
Multiple output modifiers can be combined.
Where more than one output field is required, either because multiple
.Fl Q Ar query-modifier
options were given, or one or more
.Fl Q Ar query-modifier
option was combined with the
.Fl "L comment"
or
.Fl "L description"
options, then each output field will be tagged with the field name.
.Bl -tag -width 2n
.It Sy annotations
Arbitrary text in tag-value format that can be added to any package.
.It Sy arch
The architecture string indicating what OS version and CPU architecture
the package is suitable for.
For example,
.Ar freebsd:9:x86:64
indicates a package suitable for FreeBSD 9.x running on an amd64 processor,
while
.Ar freebsd:*
indicates an architecture independent package suitable for any version of
FreeBSD.
.It Sy categories
All categories, real and virtual, the underlying package belongs to,
derived from the
.Cm CATEGORIES
variable in the port's
.Fa Makefile .
.It Sy comment
The one line comment field describing the port, derived from the
.Cm COMMENT
variable in the port's
.Fa Makefile .
.It Sy depends-on
The list of packages the named package depends on.
Dependency packages are listed in the format
.Sy name Ns - Ns Cm version
one per line.
If the port has no dependencies, nothing will be output for
this field, including suppressing the tag name when multiple
output fields are requested.
.It Sy description
The multi-line package description from the
.Fa pkg-descr
file in the port.
This does include the
.Cm WWW
URL reference, if any, from that file.
.It Sy full
Show a standard set of fields, equivalent to a combination of the
.Sy name ,
.Sy version ,
.Sy origin ,
.Sy prefix ,
.Sy repository ,
.Sy categories ,
.Sy license ,
.Sy maintainer ,
.Sy www ,
.Sy comment ,
.Sy options ,
.Sy shared-libs-required ,
.Sy shared-libs-provided ,
.Sy annotations ,
.Sy size ,
.Sy pkg-size
and
.Sy descr
fields, in that order.
.It Sy licenses
Displays a list of all the licenses the package is released under on a
single line.
Where more than one license applies, indicate if the terms of all
licenses should apply
.Sy (&)
or if one or more licenses may be selected out of those available
.Sy (|) .
.It Sy maintainer
Display the maintainer's e-mail address.
.It Sy name
Display the port name, which is derived from the
.Cm PORTNAME
variable in the port's
.Fa Makefile .
.It Sy options
Displays a list of the port options and their state (
.Sy on
or
.Sy off )
when the package was built.
If the package does not have any options to set, nothing will be
output for this field, including suppressing the tag name when
multiple output fields are requested.
.It Sy pkg-size
Display the size of the compressed package tarball, i.e., how much would
need to be downloaded from the repository.
.It Sy prefix
Display the installation prefix for the package, usually
.Fa /usr/local .
.It Sy repository
Displays the repository name and the corresponding base URL for the
repository.
For a default repository defined in
.Pa pkg.conf .
.It Sy required-by
Displays all of the packages in the repository that require the named
package as a dependency.
Dependency packages are listed in the format
.Sy name Ns - Ns Cm version
one per line.
If no other packages require the named package, nothing will be
output for this field, including suppressing the tag name when
multiple output fields are requested.
.It Sy shared-libs-required
If the package contains dynamically linked FreeBSD ELF binaries,
display a list of all of the shared libraries other than those from
the base system required for those binaries to run.
Shared libraries for foreign (e.g., Linux) binaries run
under emulation will not be displayed.
If the package does not require any shared libraries, nothing will be
output for this field including suppressing the tag name when multiple
fields are requested.
.It Sy shared-libs-provided
If the package contains any shared libraries, display a list of
the library names, including the ABI version number, if any.
A shared library, of either the same or differing ABI versions, may
legitimately be provided by more than installed package,
but this frequently indicates a problem.
.It Sy size
Display the total amount of filesystem space the package files will
take up once unpacked and installed.
.It Sy url
Display the URL that would be used to download the package from the
repository.
.It Sy version
Display the package version, which is derived from the
.Cm PKGVERSION
variable in the port's
.Fa Makefile .
.It Sy www
Display the general URL, if any, for the project developing the
software used in the package.
This is extracted from the
.Fa pkg-descr
file in the port.
.El
.Pp
Any unambiguous prefix of the query modifier name may be used on the
command line.
Thus
.Fl "Qm" ,
.Fl "Q maint"
and
.Fl "Q maintainer"
are all equivalent,
but you need to use at least
.Fl "Q si"
and
.Fl "Q sh"
to distinguish
.Cm size
from
.Cm shared-libs-required
or
.Cm shared-libs-provided ,
and you'll need at least
.Fl "Q shared-libs-p"
to select the
.Cm shared-libs-provided
unambiguously.
.Sh ENVIRONMENT
The following environment variables affect the execution of
.Nm .
See
.Xr pkg.conf 5
for further description.
.Bl -tag -width ".Ev NO_DESCRIPTIONS"
.It Ev PKG_DBDIR
.It Ev CASE_SENSITIVE_MATCH
.El
.Sh FILES
See
.Xr pkg.conf 5 .
.Sh SEE ALSO
.Xr pkg_printf 3 ,
.Xr pkg_repos 3 ,
.Xr pkg-repository 5 ,
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
.Xr pkg-check 8 ,
.Xr pkg-clean 8 ,
.Xr pkg-config 8 ,
.Xr pkg-convert 8 ,
.Xr pkg-create 8 ,
.Xr pkg-delete 8 ,
.Xr pkg-fetch 8 ,
.Xr pkg-info 8 ,
.Xr pkg-install 8 ,
.Xr pkg-lock 8 ,
.Xr pkg-query 8 ,
.Xr pkg-register 8 ,
.Xr pkg-repo 8 ,
.Xr pkg-rquery 8 ,
.Xr pkg-set 8 ,
.Xr pkg-shell 8 ,
.Xr pkg-shlib 8 ,
.Xr pkg-ssh 8 ,
.Xr pkg-stats 8 ,
.Xr pkg-update 8 ,
.Xr pkg-updating 8 ,
.Xr pkg-upgrade 8 ,
.Xr pkg-version 8 ,
.Xr pkg-which 8