forked from freebsd/pkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkg-query.8
398 lines (398 loc) · 9.28 KB
/
pkg-query.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
.\"
.\" 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
.\" $FreeBSD$
.\"
.Dd November 18, 2014
.Dt PKG-QUERY 8
.Os
.Sh NAME
.Nm "pkg query"
.Nd query information for installed packages
.Sh SYNOPSIS
.Nm
.Ao query-format Ac Ao pkg-name Ac
.Pp
.Nm
.Op Fl a
.Ao query-format Ac
.Nm
.Fl F Ao pkg-file Ac Ao query-format Ac
.Nm
.Fl e Ao evaluation-condition Ac Ao query-format Ac
.Nm
.Op Fl Cgix
.Ao query-format Ac Ao pattern Ac Ao ... Ac
.Pp
.Nm
.Op Cm --all
.Ao query-format Ac
.Nm
.Cm --file Ao pkg-file Ac Ao query-format Ac
.Nm
.Cm --evaluate Ao evaluation-condition Ac Ao query-format Ac
.Nm
.Op Cm --{case-sensitive,glob,case-insensitive,regex}
.Ao query-format Ac Ao pattern Ac Ao ... Ac
.Sh DESCRIPTION
.Nm
is used for displaying information about packages.
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width evaluate
.It Fl a , Cm --all
Match all packages from the database
.It Fl C , Cm --case-sensitive
Make the standard or the regular expression
.Fl ( x )
matching against
.Ar pkg-name
case sensitive.
.It Fl e , Cm --evaluate
Match packages using the given
.Ar evaluation-condition.
See EVALUATION FORMAT for details.
.It Fl F Ar pkg-file , Cm --file Ar pkg-file
Display information only for the package file
.Ar pkg-name
.It Fl i , Cm --case-insensitive
Make the standard or regular expression
.Fl ( x )
matching against
.Ar pkg-name
case insensitive.
This is the default, unless modified by setting
.Ev CASE_SENSITIVE_MATCH
to true in
.Pa pkg.conf .
.It Fl g , Cm --glob
Treat
.Ao pattern Ac
as a glob pattern.
.It Fl x , Cm --regex
Treat
.Ao pattern Ac
as a regular expression according to the "modern" or "extended" syntax
of
.Xr re_format 7 .
.El
.Sh QUERY FORMAT
There are two types of keywords for the query format: the multiline and the normal
one. Only one type of multiline pattern is accepted for a given query.
.Ss Normal patterns:
.Bl -tag -width F1
.It Cm \&%n
Name of the matched package
.It Cm \&%v
Version of the matched package
.It Cm \&%o
Origin of the matched package
.It Cm \&%p
Prefix of the matched package
.It Cm \&%m
Maintainer of the matched package
.It Cm \&%c
Comment of the matched package
.It Cm \&%e
Description of the matched package
.It Cm \&%w
Home page of the matched package
.It Cm \&%l
License logic of the matched package - nothing for single, & for AND, and | for OR
.It Cm \&%s Ns Op bh
The flat size of the matched package, where
.Cm b
is in bytes, and
.Cm h
is in human readable format.
.It Cm \&%a
Returns 1 if the matched package was automatically installed
as a dependency of another package, 0 otherwise.
The package can be automatically removed via
.Sq pkg autoremove
when this flag is set and no other package depends on it.
.It Cm \&%q
Architecture of the matched package
.It Cm \&%k
Returns 1 if the matched package is locked against modification or deletion, 0 otherwise
.It Cm \&%M
message contained in the matched package
.It Cm \&%t
Timestamp that the package was installed
.It Cm \&%R
The name of the repository from which the package was installed if
available, or
.Dq unknown-repository
otherwise.
.It Cm \&%? Ns Op drCFODLUGBbA
Returns 0 if the list is empty and 1 if the list has information to display
.Bl -tag -width indent
.It Cm d
for dependencies
.It Cm r
for reverse dependencies
.It Cm C
for categories
.It Cm F
for files
.It Cm O
for options
.It Cm D
for directories
.It Cm L
for licenses
.It Cm U
for users
.It Cm G
for groups
.It Cm B
for required shared libraries
.It Cm b
for provided shared libraries
.It Cm A
for annotations
.El
.It Cm \&%# Ns Op drCFODLUGBbA
Returns the number of elements in the list
.Bl -tag -width indent
.It Cm d
for dependencies
.It Cm r
for reverse dependencies
.It Cm C
for categories
.It Cm F
for files
.It Cm O
for options
.It Cm D
for directories
.It Cm L
for licenses
.It Cm U
for users
.It Cm G
for groups
.It Cm b
for shared
.It Cm B
for required shared libraries
.It Cm b
for provided shared libraries
.It Cm A
for annotations
.El
.El
.Ss Multiline patterns:
.Bl -tag -width F1
.It Cm \&%d Ns Op nov
Expands to the list of dependencies for the matched package, where
.Cm n
stands for the package name,
.Cm o
for the package origin, and
.Cm v
for the package version.
.It Cm \&%r Ns Op nov
Expands to the list of reverse dependencies for the matched package, where
.Cm n
stands for the package name,
.Cm o
for the package origin, and
.Cm v
for the package version.
.It Cm \&%C
Expands to the list of categories the matched package belongs to.
.It Cm \&%F Ns Op ps
Expands to the list of files of the matched package, where
.Cm p
stands for path, and
.Cm s
for sum.
.It Cm \&%D
Expands to the list of directories of the matched package.
.It Cm \&%O Ns Op kvdD
Expands to the list of options of the matched package, where
.Cm k
stands for option key,
.Cm v
for option value,
.Cm d
for option default value and
.Cm D
for option description.
Option default values and descriptions are optional metadata and may
be blank for certain packages.
.It Cm \&%L
Expands to the list of license(s) for the matched package.
.It Cm \&%U
Expands to the list of users needed by the matched package.
.It Cm \&%G
Expands to the list of groups needed by the matched package.
.It Cm \&%B
Expands to the list of shared libraries used by programs from the matched package.
.It Cm \&%b
Expands to the list of shared libraries provided by the matched package.
.It Cm \&%A Ns Op tv
Expands to the list of annotations for the matched package,
where
.Cm t
stands for the annotation tag, and
.Cm v
stands for the annotation value.
.El
.Sh EVALUATION FORMAT
Packages can be selected by using expressions comparing
.Ar Variables
(see below) to string or integer values. The mode of comparison is specified
by the
.Ar Operator
(also listed below).
Expressions can be combined using && (for and) and || (for or).
Parentheses can be used for grouping in the usual manner.
.Pp
String values are either any text not containing whitespace (possibly
followed by but not including whitespace) or any text enclosed in single or
double quotes.
.Ss Variables
.Bl -tag -width F1
.It Cm \&%n
Name of the package (type string)
.It Cm \&%o
Origin of the package (type string)
.It Cm \&%p
Prefix of the package (type string)
.It Cm \&%m
Maintainer of the package (type string)
.It Cm \&%c
Comment of the package (type string)
.It Cm \&%e
Description of the package (type string)
.It Cm \&%w
WWW address of the package (type string)
.It Cm \&%s
Flatsize of the package (type integer)
.It Cm \&%a
Automatic status of the package (type integer)
.It Cm \&%q
Architecture of the package (type string)
.It Cm \&%k
Locking status of the package (type integer)
.It Cm \&%M
Message of the package (type string)
.It Cm \&%t
Timestamp that the package was installed (type integer)
.It Cm \&%i
Additional information about the package (type string)
.It Cm \&%# Ns Op drCFODLUGBbA
Number of elements in the list of information (type integer).
See
.Cm %?
above for what information is used.
.El
.Ss Operators
.Bl -tag -width F1
.It Cm ~
String glob pattern matching
.It Cm > Ns Op =
Integer comparison
.It Cm < Ns Op =
Integer comparison
.It Cm = Ns Op =
Integer or string equality comparison
.It Cm !=
Integer or string inequality comparison
.El
.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 EXIT STATUS
.Ex -std
.Sh EXAMPLES
List all installed packages by name-version:
.Dl $ pkg query %n-%v
.Pp
List all dependencies for a package by origin:
.Dl $ pkg query %do subversion
.Pp
List all dependencies by package name-version:
.Dl $ pkg query %dn-%dv subversion
.Pp
List all reverse dependencies for a package:
.Dl $ pkg query %ro perl
.Pp
List all files and their known checksums for a package:
.Dl $ pkg query '%Fp %Fs' perl
.Pp
List all files for all packages:
.Dl $ pkg query '%o: %Fp'
.Pp
List all packages with no reverse dependencies:
.Dl $ pkg query -e '%#r = 0' %o
.Pp
List non-automatic packages:
.Dl $ pkg query -e '%a = 0' %o
.Pp
List automatic packages:
.Dl $ pkg query -e '%a = 1' %o
.Pp
List unmaintained packages:
.Dl $ pkg query -e '%m = [email protected]' %o
.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-register 8 ,
.Xr pkg-repo 8 ,
.Xr pkg-rquery 8 ,
.Xr pkg-search 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