/
pkg-query.1
157 lines (157 loc) · 4.1 KB
/
pkg-query.1
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
.\"
.\" 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.1
.\" $FreeBSD$
.\"
.Dd January 24, 2012
.Dt PKG-QUERY 1
.Os
.Sh NAME
.Nm "pkg query"
.Nd query information for installed packages
.Sh SYNOPSIS
.Nm
.Fl a Ao query format Ac
.Nm
.Fl f Ao pkg-name Ac Ao query-format Ac
.Nm
.Op Fl gxX
.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 F1
.It Fl a
Match all packages from the database
.It Fl f Ar pkg-name
Display information only for the package file
.Ar pkg-name
.It Fl g
Treat
.Ao pattern Ac
as a glob pattern.
.It Fl x
Treat
.Ao pattern Ac
as a regular expression.
.It Fl X
Treat
.Ao pattern Ac
as an extended regular expression.
.El
.Sh QUERY FORMAT
There are two type of keyword 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 \fB%n\fB
Name of the matched package
.It \fB%v\fB
Version of the matched package
.It \fB%o\fB
Origin of the matched package
.It \fB%p\fB
Prefix of the matched package
.It \fB%m\fB
Maintainer of the matched package
.It \fB%c\fB
Comment of the matched package
.It \fB%w\fB
Home page of the matched package
.It \fB%l\fB
license logic of the matched package - nothing for single, & for AND, and | for OR
.It \fB%sh\fB
The flat size in human readable format of the matched package
.It \fB%sb\fB
The flat size in bytes of the matched package
.It \fB%a\fB
Returns 1 if the matched package is an orphan package and can be pkg-autoremove(1)'d, 0 otherwise
.It \fB%?[drCFIDLUG]\fB
Returns 0 if the list is empty and 1 if the list has information to display
.Bl -tag -width indent
.It \fBd\fB
for dependencies
.It \fBr\fB
for reverse dependencies
.It \fBC\fB
for categories
.It \fBF\fB
for files
.It \fBO\fB
for options
.It \fBD\fB
for directories
.It \fBL\fB
for licenses
.It \fBU\fB
for users
.It \fBG\fB
for groups
.El
.Ss Multiline patterns:
.Bl -tag -width F1
.It \fB%d[nov]\fB
Expands to the list of dependencies for the matched package, where \fBn\fP stand for the package name,
\fBo\fP for the package origin, and \fBv\fP for the package version.
.It \fB%r[nov]\fB
Expands to the list of reverse dependencies for the matched package, where \fBn\fP stand for the
package name, \fBo\fP for the package origin, and \fBv\fP for the package version.
.It \fB%C\fB
Expands to the list of categories the matched package belongs to.
.It \fB%F[ps]\fB
Expands to the list of files of the matched package, where \fBp\fP stand for path, and \fBs\fP for sum.
.It \fB%O[kv]\fB
Expands to the list of options of the matched package, where \fBk\fP stand for option key,
and \fBv\fP for option value.
.It \fB%L\fB
Expands to the list of license(s) for the matched package.
.It \fB%U\fB
Expands to the list of users needed by the matched package.
.It \fB%G\fB
Expands to the list of groups needed by the matched package.
.It \fB%S\fB
Expands to the list of scripts for the matching packages - install, deinstall, etc.
.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 PKG_DBDIR
.El
.Sh FILES
See
.Xr pkg.conf 5 .
.Sh SEE ALSO
.Xr pkg 1 ,
.Xr pkg-add 1 ,
.Xr pkg-autoremove 1 ,
.Xr pkg-search 1 ,
.Xr pkg-backup 1 ,
.Xr pkg-install 1 ,
.Xr pkg-delete 1 ,
.Xr pkg-create 1 ,
.Xr pkg-register 1 ,
.Xr pkg-repo 1 ,
.Xr pkg-update 1 ,
.Xr pkg-upgrade 1 ,
.Xr pkg-version 1 ,
.Xr pkg-which 1 ,
.Xr pkg.conf 5