xref: /openbsd-src/usr.sbin/pkg_add/pkg_mklocatedb.1 (revision 4a75a5de97c7b4b60ee138e5449cc6eb761b49e3)
1.\"	$OpenBSD: pkg_mklocatedb.1,v 1.18 2021/11/26 12:08:35 espie Exp $
2.\" Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org>
3.\"
4.\" Permission to use, copy, modify, and distribute this software for any
5.\" purpose with or without fee is hereby granted, provided that the above
6.\" copyright notice and this permission notice appear in all copies.
7.\"
8.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15.\"
16.Dd $Mdocdate: November 26 2021 $
17.Dt PKG_MKLOCATEDB 1
18.Os
19.Sh NAME
20.Nm pkg_mklocatedb
21.Nd create a locate database for packages
22.Sh SYNOPSIS
23.Nm pkg_mklocatedb
24.Bk -words
25.Op Fl aKnPqu
26.Op Fl d Ar repository
27.Op Fl p Ar portsdir
28.Op Ar pkg-name ...
29.Ek
30.Sh DESCRIPTION
31The
32.Nm
33command is used to create a file database for binary packages,
34which can be searched using the
35.Xr locate 1
36utility.
37.Pp
38Entries created for each package will have the package name prepended:
39.Li kdelibs-3.3.2p2:/usr/local/bin/meinproc .
40.Pp
41If the
42.Fl p
43option is used,
44and
45.Ev SUBDIRLIST
46is not defined,
47.Nm
48will retrieve all package entries from the ports tree.
49.Pp
50If the
51.Fl p
52option is used
53together with
54.Ev SUBDIRLIST ,
55.Nm
56will retrieve the package entries listed in
57.Ev SUBDIRLIST
58from the ports tree.
59.Pp
60Otherwise,
61.Nm
62will build database entries for every file object for each
63.Ar pkg-name
64given on the command line,
65or for every package in a
66.Ar repository
67specified as the
68.Fl d
69option.
70If no package name is given,
71.Nm
72will build database entries for all currently installed packages.
73.Pp
74By default (unless standard output is a terminal),
75the list of names is fed to
76.Pa /usr/libexec/locate.mklocatedb
77and the end result should be redirected to a file.
78.Pp
79The options are as follows:
80.Bl -tag -width Ds
81.It Fl a
82Prepend file names with pkgpath information and package names.
83.It Fl d Ar repository
84Scan directory
85.Ar repository
86for packages.
87.It Fl K
88Include keyword in each object full name.
89This is more accurate, but defeats
90.Xr locate 1
91compression.
92.Pp
93However, note that some meta annotations always make it into the database:
94.Cm @*exec* ,
95.Cm @define-tag ,
96.Cm @newgroup ,
97.Cm @newuser ,
98.Cm @option Ar no-default-conflict
99and
100.Cm @tag .
101.It Fl n
102Do not pipe output to
103.Pa /usr/libexec/locate.mklocatedb
104(default if standard output is a terminal).
105.It Fl P
106Prepend file names with pkgpath information instead of package name.
107.It Fl p Ar portsdir
108Retrieve packing-lists from the ports tree instead of binary packages.
109.It Fl q
110Be quiet: do not report every package processed to standard error.
111.It Fl u
112Update an existing list.
113The list must come from standard input, and contain pkgpath information
114for items to be replaced.
115.El
116.Sh SEE ALSO
117.Xr locate 1 ,
118.Xr pkg_info 1
119.Sh AUTHORS
120.An Marc Espie
121