xref: /openbsd/usr.sbin/pkg_add/pkg_info.1 (revision 4cfece93)
1.\"	$OpenBSD: pkg_info.1,v 1.63 2020/02/19 14:24:19 espie Exp $
2.\"
3.\" Documentation and design originally from FreeBSD. All the code has
4.\" been rewritten since. We keep the documentation's notice:
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" Jordan K. Hubbard
16.\"
17.\"
18.Dd $Mdocdate: February 19 2020 $
19.Dt PKG_INFO 1
20.Os
21.Sh NAME
22.Nm pkg_info
23.Nd display information on software packages
24.Sh SYNOPSIS
25.Nm pkg_info
26.Bk -words
27.Op Fl AaCcdfIKLMmPqRSstUvz
28.Op Fl D Ar name Ns Op = Ns Ar value
29.Op Fl E Ar filename
30.Op Fl e Ar pkg-name
31.Op Fl l Ar str
32.Op Fl Q Ar query
33.Op Fl r Ar pkgspec
34.Op Ar pkg-name ...
35.Ek
36.Sh DESCRIPTION
37The
38.Nm
39command is used to dump out information for packages, as created by
40.Xr pkg_create 1 ,
41which may be still
42packed up or already installed on the system with the
43.Xr pkg_add 1
44command.
45.Pp
46The
47.Ar pkg-name
48may be the name of an installed package, the pathname to a package
49distribution file, or a URL to a package available through FTP, HTTP, HTTPS,
50or SCP.
51.Nm
52will try to complete
53.Ar pkg-name
54with a version number while looking through installed packages.
55.Pp
56When browsing through uninstalled packages, running
57.Ic pkg_info -I *.tgz
58will report a summary line for each package, so that it is possible to
59run
60.Ic pkg_info pkgname.tgz
61to obtain a longer package description, and
62.Ic pkg_add -n pkgname.tgz
63to check that the installation would proceed cleanly, including dependencies.
64.Pp
65The following command-line options are supported:
66.Bl -tag -width indent
67.It Fl A
68Show information for all currently installed packages,
69including internal packages.
70.It Fl a
71Show information for all currently installed packages.
72.It Fl C
73Show certificate information for signed packages.
74.It Fl c
75Show the one-line comment field for each package.
76.It Fl D Ar name Ns Op = Ns Ar value
77Enforce extra options as given by
78.Ar name ,
79similarly to
80.Xr pkg_add 1 .
81.Pp
82.Bl -tag -width "updatedependsXX" -compact
83.It Cm SIGNER
84List of trusted signers, separated by commas.
85Corresponds to list of public keys under
86.Pa /etc/signify
87we want to trust.
88Defaults to any key matching
89.Sq *pkg
90for packages, and any key matching
91.Sq *fw
92for firmware.
93.It Cm snap
94Force
95.Sq %c
96and
97.Sq %m
98to expand to
99.Sq snapshots ,
100even on a release kernel.
101.It Cm unsigned
102Allow opening unsigned packages without warnings/errors
103(necessary for
104.Xr ports 7 ,
105automatically set by the build infrastructure).
106.El
107.It Fl d
108Show the long-description field for each package.
109.It Fl E Ar filename
110Look for the package(s) that contains the given
111.Ar filename .
112As a faster alternative, note that there is a package, pkglocatedb, that
113contains a
114.Xr locate 1
115database of every file in every package.
116.It Fl e Ar pkg-name
117This option
118allows you to test for the presence of another (perhaps
119prerequisite) package from a script.
120If the package identified by
121.Ar pkg-name
122is currently installed, return 0, otherwise return 1.
123In addition, the names of any package(s) found installed are printed to
124stdout unless turned off using the
125.Fl q
126option.
127.Pp
128The given
129.Ar pkg-name
130is actually a package specification, as described in
131.Xr packages-specs 7 .
132For example,
133.Ic pkg_info -e 'name->=1.3'
134will match versions 1.3 and later of the
135.Pa name
136package.
137.It Fl e Ar pkgpath
138Another variant of this option that uses a pkgpath instead.
139A pkgpath is a location within the ports tree, as described
140in
141.Xr pkgpath 7 .
142For example,
143.Ic pkg_info -e x11/kde/base3
144will match any package that was compiled according to
145.Pa ${PORTSDIR}/x11/kde/base3 .
146.It Fl f
147Show the packing-list instructions for each package.
148See
149.Xr pkg_create 1
150and
151.Xr package 5
152for the various annotations.
153.It Fl I
154Show the index entry for each package.
155.It Fl K
156Prefix file names with category keyword (e.g., @file, @lib).
157Always used together with
158.Fl L .
159.It Fl L
160Show the files within each package.
161This is different from just
162viewing the packing-list, since full pathnames for everything
163are generated.
164.It Fl l Ar str
165Prefix each information category header (see
166.Fl q )
167shown with
168.Ar str .
169This is primarily of use to front-end programs that want to request a
170lot of different information fields at once for a package, but don't
171necessarily want the output intermingled in such a way that they can't
172organize it.
173This lets you add a special token to the start of each field.
174.It Fl M
175Show the install-message file (if any) for each package.
176.It Fl m
177Only show packages tagged as manual installations.
178It should omit anything
179installed automatically as a dependency.
180.It Fl P
181Show the
182.Xr pkgpath 7
183for each package.
184You can easily build a subdirlist with this.
185.It Fl Q Ar query
186Show packages in the package search path which match the given
187.Ar query .
188Specifically, show all packages in the first repository that matches
189the query.
190If
191.Fl a
192is also specified, show all packages in all repositories instead.
193.It Fl q
194Be
195.Dq quiet
196in emitting report headers and such, just dump the
197raw info (basically, assume a non-human reading).
198.It Fl R
199Show which packages require a given package.
200.It Fl r Ar pkgspec
201Check a list for a given
202.Ar pkgspec .
203The following arguments are names of packages to verify.
204Exit status will be augmented by 2 if none of the packages do match.
205.It Fl S
206Show the update signature for each package.
207The
208.Sq update signature
209is a unique tag showing the package name, a global version number,
210and the version number
211of every run time dependency and shared library used to build this package.
212.It Fl s
213Show an estimate of the total size of each package.
214.It Fl t
215Show packages which are not required by any other packages.
216.It Fl U
217Show the deinstall-message file (if any) for each package.
218.It Fl v
219Turn on verbose output.
220.It Fl z
221Fuzzy listing option, often used together with
222.Fl m .
223Only shows stems, flavors and branches information.
224To be reused with
225.Xr pkg_add 1
226.Fl l
227to recreate a package installation with different versions and no ambiguity.
228Note that this intentionally does not include firmware, as they are not
229handled by
230.Xr pkg_add 1 .
231.El
232.Sh ENVIRONMENT
233.Bl -tag -width PKG_TMPDIR
234.It Ev PKG_DBDIR
235The standard package database directory,
236.Pa /var/db/pkg ,
237can be overridden by specifying an alternative directory in the
238.Ev PKG_DBDIR
239environment variable.
240.It Ev PKG_PATH
241This can be used to specify a colon-separated list of paths to search for
242package files.
243The current directory is always searched first, even if
244.Ev PKG_PATH
245is set.
246If
247.Ev PKG_PATH
248is used, the suffix
249.Dq .tgz
250is automatically appended to the
251.Ar pkg-name ,
252whereas searching in the current directory uses
253.Ar pkg-name
254literally.
255Each entry consists of a directory name.
256URL schemes such as FTP, HTTP, HTTPS, or SCP are also appropriate.
257The current directory may be indicated
258implicitly by an empty directory name, or explicitly by a single
259period
260.Pq Ql \&./ .
261Special sequences
262.Sq %a ,
263.Sq %c ,
264.Sq %m ,
265.Sq %v
266will be expanded.
267.It Ev PKG_TMPDIR
268Temporary area where package information files will be extracted, instead of
269.Pa /tmp .
270.It Ev TRUSTED_PKG_PATH
271Same semantics as
272.Ev PKG_PATH ,
273but it is searched before
274.Ev PKG_PATH
275and waives any kind of signature checking.
276.El
277.Sh FILES
278.Bl -tag -width /var/db/pkg/
279.It Pa /usr/local/share/doc/pkg-readmes/
280.Ox Ns -specific
281information about individual packages
282.It Pa /var/db/pkg/
283database of installed
284.Xr packages 7
285.El
286.Sh TECHNICAL DETAILS
287Package info is either extracted from package files named on the
288command line, or from already installed package information
289in
290.Pa /var/db/pkg/<pkg-name> .
291.Sh SEE ALSO
292.Xr pkg_add 1 ,
293.Xr pkg_create 1 ,
294.Xr pkg_delete 1 ,
295.Xr bsd.port.mk 5 ,
296.Xr package 5 ,
297.Xr packages-specs 7 ,
298.Xr pkgpath 7
299.Sh AUTHORS
300.Bl -tag -width indent -compact
301.It An Jordan Hubbard
302initial design
303.It An Marc Espie
304complete rewrite
305.El
306