/
pkg_replace.1
350 lines (350 loc) · 6.42 KB
/
pkg_replace.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
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
.\" $Id: pkg_replace.1,v 1.2 2007/01/25 12:25:56 securedog Exp $
.\"
.\" Modified by Ken DEGUCHI (May 18, 2024)"
.Dd May 18, 2024
.Dt PKG_REPLACE 1
.Os
.Sh NAME
.Nm pkg_replace
.Nd a utility for upgrading installed packages
.Sh SYNOPSIS
.Nm
.Op Fl habBcCddfFiJknNOpPPqrRRuUvVwW
.Op Fl \-automatic
.Op Fl \-batch
.Op Fl \-clean
.Op Fl \-cleanup
.Op Fl \-config
.Op Fl \-debug
.Op Fl \-force-config
.Op Fl \-noclean
.Op Fl \-nocleanup
.Op Fl \-nocleandeps
.Op Fl \-noconfig
.Op Fl \-version
.Op Fl j Ar jobs
.Op Fl l Ar file
.Op Fl L Ar prefix
.Op Fl m Ar make_args
.Op Fl M Ar make_env
.Op Fl t Ar make_target
.Op Fl x Ar pkgname
.Op Fl X Ar pkgname
.Oo
.Op Ar pkgname\fR[=\fIpackage\fR]
.Op Ar package
.Op Ar pkgorigin
.Ar ...
.Oc
.Sh DESCRIPTION
The
.Nm
command is used to upgrade installed packages.
.Sh OPTIONS
The following options are supported:
.Bl -tag -width "-l FILE"
.Pp
.It Fl h
Show help and exit.
.Pp
.It Fl a
Do with all the installed packages.
.Pp
.It Fl b
Keep backup packages of the old versions.
By default, the created backup package will be deleted after installation.
.Pp
.It Fl B
Do not backup old packages.
.Pp
.It Fl \-automatic
Set automatic flag for the package.
This affects the operation of pkg-autoremove(8).
.Pp
.It Fl \-batch
Run an upgrading process in a batch mode (with BATCH=yes).
.Pp
.It Fl c , Fl \-config
Do
.Dq Li make config-conditional
before build.
.It Fl C , Fl \-force-config
Do
.Dq Li make config
before build.
.Pp
.It Fl \-clean
Do
.Dq Li make clean
before build.
.Pp
.It Fl \-cleanup
Do
.Dq Li make clean
after build.
This is the default.
.Pp
.It Fl d , Fl R
In addition to the specified packages,
replace all packages that required by those packages as well.
.Pp
.It Fl dd , Fl RR
Strictly checking dependencies more than
.Fl d, Fl R,
e.g. build dependencies.
However, this mode is slow.
So,
.Nm
creates temporary files in the
.Ar PKG_REPLACE_DB_DIR
directory to run as fast as possible.
See config file,
.Ar pkg_replace.conf.sample .
If you set
.Fl \-nocleandeps ,
.Nm
does not clean this directory.
.Pp
This option may fail when there are dependency problems
(e.g., packages have looped dependencies, packages removed the ports tree).
Especially, be careful when using
.Fl a
option at the same time.
.Pp
.It Fl \-debug
Debug mode.
Execute with
.Dq Li set -x
option.
.Pp
.It Fl f
Force to replace packages.
.Pp
.It Fl F
Fetch distfiles or packages, do not replace.
.Pp
.It Fl i
Turn on interactive mode.
.Pp
.It Fl j Ar jobs
Number of parallel jobs.
Default value gets from `sysctl -n hw.ncpu`.
.Pp
.It Fl J
Do not install the target packages, but install the dependencies.
.Pp
.It Fl k
Force the upgrade of a package even if some of the requisite packages have failed to upgrade in advance.
.Pp
.It Fl l Ar FILE
Save the results to
.Ar FILE .
By default,
.Nm
does not save results.
.Pp
.It Fl L Ar PREFIX
Save the logs in the files that begins with
.Ar PREFIX .
.It Fl m Ar ARGS
Specify arguments to append to each
.Xr make 1
command.
Please see section
.Ar EXAMPLES.
.Pp
.It Fl M Ar ARGS
Specify arguments to prepend to each
.Xr make 1
command.
.Pp
.It Fl n
Do not actually replace any packages.
.Pp
.It Fl \-nocleandeps
Do not clean
.Ar PKG_REPLACE_DB_DIR .
See option
.Fl dd ,
.Fl RR .
.Pp
.It Fl \-noconfig
Do not read the configuration file.
.Pp
.It Fl N
Install new packages, do not replace.
.Pp
.It Fl O
Do not check the dependencies before building the target packages.
.Pp
.It Fl p
Do
.Dq Li make package .
.Pp
.It Fl P
Use binary packages instead of installing from source.
.Nm
finds them from the directory specified by
.Va PKGREPOSITORY ,
and the remote site specified by
.Va PACKAGEROOT .
.Pp
.It Fl PP
Be forced to use binary packages.
Never use the port even if a package is not available either locally or remotely.
.Pp
.It Fl r
In addition to the specified packages,
replace all packages that depend on those packages as well.
.Pp
.It Fl t Ar make_target
Do
.Dq Li make make_target
only.
.Pp
.It Fl U
Unlock packages before deinstall packages and lock packages again after install.
.Pp
.It Fl u
Do not preserve old shared libraries.
By default,
.Nm
preserves old shared libraries in
.Va PKGCOMPATDIR .
But if the new library and the old library have the same name, the old library is removed from
.Va PKGCOMPATDIR .
.Pp
.It Fl v
Turn on verbose output.
.Pp
.It Fl V
List the installed packages that need updating.
.Pp
.It Fl \-version
Print pkg_replace version.
.Pp
.It Fl w , Fl \-noclean
Do not
.Dq Li make clean
before each build.
This is the default.
.Pp
.It Fl W , Fl \-nocleanup
Do not
.Dq Li make clean
after each installation.
.Pp
.It Fl x Ar GLOB
Do not replace packages matching the specified glob pattern.
.Pp
.It Fl X Ar GLOB
Remove the libraries in
.Va PKGCOMPATDIR ,
when the specified packages have the libraries with the same name as the one in
.Va PKGCOMPATDIR .
This may be useful when there are errors due to a mixture of old and new libraries.
.Pp
.El
.Sh EXAMPLES
.Bl -bullet
.It
pkgname examples:
.Pp
.Dl name-version, name and shell glob.
.Dl glib-2.36.3_2, glib and Dq glib*
.Pp
.It
pkgorigin examples:
.Pp
.Dl devel/glib20
.Pp
.It
Path:
.Pp
.Dl Absolute and relative paths are allowed.
.Pp
.It
Install
.Ar glib :
.Pp
.Dl pkg_replace -N devel/glib20
.It
Install
.Ar py-cairo
with
.Ar FLAVOR=py37
.Pp
.Dl pkg_replace -N graphics/py-cairo@py37
.It
Replace
.Ar glib :
.Pp
.Dl pkg_replace glib
.It
Replace
.Ar perl
and all packages that depend on it:
.Pp
.Dl pkg_replace -r perl
.It
If the
.Ar xterm
package is already installed, replace it with
.Ar xterm-220 :
.Pp
.Dl pkg_replace /usr/ports/packages/All/xterm-220.tbz
.It
Replace
.Ar XFree86-libraries
with
.Ar /usr/ports/x11/xorg-libraries:
.Pp
.Dl pkg_replace XFree86-libraries=/usr/ports/x11/xorg-libraries
.It
Replace
.Ar XFree86-libraries
with pkgorigin
.Ar x11/xorg-libraries:
.Pp
.Dl pkg_replace XFree86-libraries=x11/xorg-libraries
.It
Replace
.Ar XFree86-libraries
with
.Ar /var/tmp/xorg-libraries-6.9.0
package:
.Pp
.Dl pkg_replace XFree86-libraries=/var/tmp/xorg-libraries-6.9.0.tbz
.It
Replace
.Ar graphics/py-cairo
with
.Ar FLAVOR=py37
.Pp
.Dl pkg_replace -m FLAVOR=py37 graphics/py-cairo
or
.Dl pkg_replace graphics/py-cairo@py37
.It
Do
.Dq Li make configure
only:
.Pp
.Ar pkg_replace -t configure pkgname
.El
.Sh COMPATIBILITY
The
.Xr portupgrade 1
options
.Fl A , B , D , e , o , q , s , S
and
.Fl y
are no longer supported.
.Sh SEE ALSO
.Xr portupgrade 1 ,
.Xr pkg 8 ,
.Xr ports 7 ,
.Sh AUTHORS
.An Securedog Aq securedog@users.sourceforge.jp
.An Ken DEGUCHI Aq kdeguchi@sz.tokoha-u.ac.jp
.Sh BUGS
Sure to be some.