forked from freebsd/pkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkg-version.8
326 lines (326 loc) · 8.25 KB
/
pkg-version.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
.\"
.\" 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 09, 2014
.Dt PKG-VERSION 8
.Os
.Sh NAME
.Nm "pkg version"
.Nd summarize installed versions of packages
.Sh SYNOPSIS
.Nm
.Op Fl IPR
.Op Fl hoqvU
.Op Fl l Ar limchar
.Op Fl L Ar limchar
.Op Fl Cegix Ar pattern
.Op Fl r Ar reponame
.Op Fl O Ar origin
.Op Ar index
.Nm
.Fl t Ar version1 Ar version2
.Nm
.Fl T Ar pkgname Ar pattern
.Pp
.Nm
.Op Cm --{index,ports,remote}
.Op Cm --{help,origin,quiet,verbose,no-repo-update}
.Op Cm --like Ar limchar
.Op Cm --not-like Ar limchar
.Op Cm --{case-sensitive,exact,glob,case-insensitive,regex} Ar pattern
.Op Cm --repository Ar reponame
.Op Cm --match-origin Ar origin
.Op Ar index
.Nm
.Cm --test-version Ar version1 Ar version2
.Nm
.Cm --test-pattern Ar pkgname Ar pattern
.Sh DESCRIPTION
.Nm
is used for generating a report of packages installed by
.Xr pkg 8 .
.Pp
The database of available packages and versions to compare against the
installed packages may be chosen by specifying one of
.Fl P ,
.Fl R
or
.Fl I
or by by setting
.Cm VERSION_SOURCE
in
.Xr pkg.conf 5 .
If not specified then the ports index file
will be used if it exists
.Fl ( I ) .
Otherwise, should a ports tree exist that will be used to compare
versions
.Fl ( P ) .
Failing either of those two choices, the repository catalogue will be
used
.Fl ( R ) .
.Pp
When
.Fl I
is used, versions of installed packages will be compared to the
versions listed in the file argument
.Ar index ,
or if that is not given explicitly, in the default ports index file
(typically located as
.Pa /usr/ports/INDEX-N ,
where
.Sy N
is the OS major version number.)
.Pp
When
.Fl R
is used,
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
When comparing package versions the package name and a comparison character are printed:
.Bl -tag -width indent
.It Li =
The installed version of the package is current.
.It Li \&<
The installed version of the package is older than the current version.
.It Li \&>
The installed version of the package is newer than the current version.
This situation can arise with an out of date index file, or when
testing new ports.
.It Li \&?
The installed package does not appear in the index.
This could be due to an out of date index or a package taken from a PR
that has not yet been committed.
.It Li \&!
The installed package exists in the index but for some reason,
.Nm
was unable to compare the version number of the installed package
with the corresponding entry in the index.
.El
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width repository
.It Fl C , Cm --case-sensitive
Make the standard or the regular expression
.Fl ( x )
matching against
.Ar pkg-name
case sensitive.
.It Fl h , Cm --help
Displays usage information
.It Fl I Op Ar index
.It Cm --index Op Ar index
Use
.Pa index
file for determining if a package is out of date.
If no
.Pa index
file name is specified, uses the default index file.
This is the default, if the index file exists.
.It Fl P , Cm --ports
Use ports for determining if a package is out of date.
This is the default if the index file is not present and a ports tree
exists.
The tree used can be overridden by PORTSDIR, see
.Xr pkg 5
for more information.
.It Fl R , Cm --remote
Use repository catalogue for determining if a package is out of date.
This is the default if neither the ports index nor the ports tree
exists.
.It Fl U , Cm --no-repo-update
Suppress the automatic update of the local copy of the repository catalogue
from remote.
This only has any effect in combination with the
.Fl R
option.
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 r Ar reponame , Cm --repository Ar reponame
When using
.Fl R
compare installed package versions to packages available from the
named repository only, irrespective of the configured
.Dq active
status from
.Pa repo.conf .
By default all repository catalogues marked
.Dq active
are used for version comparisons.
.Fl R
.It Fl o , Cm --origin
Display package origin, instead of package name.
.It Fl q , Cm --quiet
Be quiet.
Less output will be produced.
.It Fl v , Cm --verbose
Be verbose.
.It Fl l Ar limchar , Cm --like Ar limchar
Display only the packages which status flag matches the one specified by
.Ar limchar.
.It Fl L Ar limchar , Cm --not-like Ar limchar
Does the opposite of
.Fl l
flag.
Displays the packages which status flag does not match the one
specified by
.Ar limchar
.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 x Ar pattern , Cm --regex Ar pattern
Only display the packages that match the regular expression.
Uses the "modern" or "extended" syntax of
.Xr re_format 7 .
.It Fl g Ar pattern , Cm --glob Ar pattern
Only display the packages that match the glob expression.
.It Fl e Ar string , Cm --exact Ar string
Only display the packages that exactly match the string.
.It Fl O Ar origin , Cm --match-origin Ar origin
Display only the packages which origin matches
.Ar origin.
.It Fl t Ar version1 Ar version2 , Cm --test-version Ar version1 Ar version2
Test a pair of version number strings and exit.
The output consists of one of the single characters
.Li =
(equal),
.Li \&<
(right-hand number greater), or
.Li \&>
(left-hand number greater) on standard output.
This flag is mostly useful for scripts or for testing.
.It Fl T Ar pkgname Ar pattern , Cm --test-pattern Ar pkgname Ar pattern
Compare
.Ar pkgname
against shell glob
.Ar pattern
and set exit code accordingly.
.Fl T
can also be used in `filter mode':
When one of the arguments is `-', standard input is used, and lines
with matching package names/patterns are echoed to standard output.
.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 CASE_SENSITIVE_MATCH
.It Ev INDEXDIR
.It Ev INDEXFILE
.It Ev PKG_DBDIR
.It Ev PORTSDIR
.El
.Pp
The default
.Pa index
file is searched for in
.Ev INDEXDIR ,
or if that is not set,
.Ev PORTSDIR .
.Ev INDEXFILE
is the name of the
.Pa index
relative to that directory.
If
.Ev INDEXFILE
is not set, the default file name is
.Pa INDEX-N
where
.Cm N
is the OS major version number.
.Sh FILES
See
.Xr pkg.conf 5 .
.Sh EXAMPLES
The following is a typical invocation of the
.Nm
command, which checks the installed packages against the local ports
index file:
.Pp
.Dl % pkg version -v
.Pp
The command below generates a report against the versions in the repository catalogue:
.Pp
.Dl % pkg update
.Dl % pkg version -vR
.Pp
The following lists packages needing upgrade, compared to the repository catalogue:
.Pp
.Dl % pkg update
.Dl % pkg version -vRL=
.Pp
The following command compares two package version strings:
.Pp
.Dl % pkg version -t 1.5 1.5.1
.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-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-which 8