OSDN Git Service

The description of the previous modification in HISTORY section of the man page was...
[portsreinstall/current.git] / man / portsreinstall.8
1 .\" ==================================================================================
2 .\" portsreinstall(8) manual page
3 .\" Copyright (C) 2010-2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
4 .\" ==================================================================================
5 .TH PORTSREINSTALL 8 "29 June 2018" "FreeBSD" "FreeBSD System Manager's Manual"
6 .SH NAME
7 portsreinstall \- ports upgrading utility for massive forced reinstallation
8 .SH SYNOPSIS
9 .B portsreinstall
10 [
11 .I
12 OPTIONS
13 ] [
14 .B
15 \-\-
16 ] [
17 .I
18 command
19 ]
20 .SH DESCRIPTION
21 This utility is an alternative to \fBportupgrade\fR(1) and \fBportmaster\fR(8), and designed to be suitable for reinstallation/upgrade of all packages after major version upgrade of the system or very long absence of ports upgrade, or for entire correction of confusion among installed packages.
22 .SH ROBUSTNESS AGAINST TERMINATION AND RESTART
23 Execution of \fBdo\fR, \fBredo\fR and \fBpackupgrade\fR commands can be terminated at any points and restarted from there with the same options saved in the temporary database (independent among utilities). The saved options can be changed by the ways depending on the assigned groups of the options. Some options can be reset only by \fBredo\fR command. The options are reset to the default by \fBclean\fR and \fBreset all\fR commands.
24 .SH FLAVOR SUPPORT
25 As of the release time of this software, the flavor support of the Ports Collection has many incomplete features.
26 Therefore, users should note that problems may arrise due to the specification changes related to flavors.
27 Currenly, coexistence with \fBportupgrade\fR(1) is suspended due to the lack of flavor support.
28 The same port configuration options of the same ports are shared among the all flavors because they are not distinguishable in the current implementation of the Ports Collection.
29 .SH GLOB PATTERNS
30 A \fIglob\fR is an extended regular expression or a shell\-type glob pattern matching either of a unique name, package names, or unflavored port origins possibly followed by flaver.
31 The format of a \fIglob\fR may be either:
32 .RS
33 .IP \fIunique_name_glob\fR
34 .IP \fIpackage_name_glob\fR
35 .IP \fIport_origin_glob\fR
36 .IP \fIport_origin_glob@flaver_glob\fR
37 .IP \fI:unique_name_regexp\fR
38 .IP \fI:package_name_regexp\fR
39 .IP \fI:port_origin_regexp\fR
40 .IP \fI:port_origin_regexp@flaver_regexp\fR
41 .RE
42 where each regular expression (*_regexp) and glob (_glob) pattern must not include any at sign (@).
43 Port origin patterns without at sign match all available flavors if deined.
44 As long as the specified port origin pattern represents ports wihout available flavor, the glob syntax is compatible with \fBportupgrade\fR(1) and its accompaniments such as \fBportsdb\fR(1), \fBpkg_glob\fR(1) and \fBports_glob\fR(1).
45 If a glob starts with a colon ":", the following string is parsed as an extended regular expression, and otherwise a shell\-type glob.
46 A shell\-type glob is evaluated by matching an asterisk "*" to an arbitrary string of an arbitrary length, a question mark "?" to an arbitrary single character, characters "..." enclosed in a bracket "[...]" to a single character as one of the characters and characters "..." in a bracket "[!...]" to a single character matching none of the characters.
47 Here, the evaluation of the bracket is actually done by passing it to an extended regular expression by simply converting the prefix "[!" to "[^".
48 A glob is recognized as a unique name (package name without the version part) if no slash "/" or any special character for an extended regular expression or a shell\-type glob is included in the pattern.
49 For example, all of "zip" "zip\-3.?", "zip\-*", "zip\-[0\-9]*" and ":^zip\-[[:digit:]]+\.*" can match "zip\-3.0"; "archivers/unzip*" can match both of "archivers/unzip" and "archivers/unzip\-iconv".
50 When the \fIglob\fR should match the all flavors of a port, a regular expression can be used such as ":devel/py-setuptools(|@.*)".
51 .SH ARGUMENTS
52 One of the following \fIcommands\fR can be given for optional operations or confirmation.
53 .TP
54 \fBdo\fR
55 .PD 0
56 .TP
57 \fBdo all\fR
58 (Default) Full execution.
59 .TP
60 \fBprepare\fR
61 .PD 0
62 .TP
63 \fBdo prepare\fR
64 Just build (or continue to build or rebuild) the temporary database and stop before the actual operations to the ports/packages.
65 .TP
66 \fBredo\fR
67 .PD 0
68 .TP
69 \fBredo all\fR
70 Execute again for failed ports and their dependents.
71 .TP
72 \fBredo prepare\fR
73 Just rebuild the temporary database and stop before the actual operations for the redo process.
74 In case of restarting a stopped \fBredo prepare\fR process, execute by \fBprepare\fR or \fBdo prepare\fR command instead of this command.
75 .TP
76 \fBclean\fR
77 .PD 0
78 .TP
79 \fBclean [normal]\fR
80 Clean up the temporary database.
81 .TP
82 \fBclean force\fR
83 Attempt to clean up the temporary database without checking the lock and privilege.
84 .TP
85 \fBreset\fR
86 .PD 0
87 .TP
88 \fBreset all\fR
89 Reset the temporary database by preserving the initial snapshot of installed packages.
90 This command can be used to restart reinstallation when the ports tree is updated after the previous run or to rescue the temporary database from destruction.
91 .TP
92 \fBreset keepopts\fR
93 Reset the temporary database by preserving the initial snapshot of installed packages, option settings and manually added \fBtaboo\fR/\fBneed\fR/\fBnoneed\fR ports.
94 This command can be used to restart reinstallation when the ports tree is updated after the previous run or to rescue the temporary database from destruction.
95 .TP
96 \fBreset keepstatus\fR
97 Reset the temporary database by preserving the progress status to reuse for unchanged successfully (re)installed ports.
98 The initial snapshot of installed packages, option settings and manually added \fBtaboo\fR/\fBneed\fR/\fBnoneed\fR ports are preserved in the same way as \fBreset keepopts\fR command.
99 This command can be used to more smartly restart reinstallation when the ports tree is updated after the previous run.
100 .TP
101 \fBok add\fR \fIglob1\fR [\fIglob2\fR ...]
102 Register manually resolved ports.
103 The port globs are separated from each other by comma or space.
104 .TP
105 \fBok del\fR \fIglob1\fR [\fIglob2\fR ...]
106 deregister manually resolved ports.
107 The port globs are separated from each other by comma or space.
108 .TP
109 \fBtaboo add\fR \fIglob1\fR [\fIglob2\fR ...]
110 Register taboo ports that must not be built or newly (re)installed.
111 The port globs are separated from each other by comma or space.
112 Registration to be "taboo" practically invalidates "necessary" registered by \fBnoneed add\fR command.
113 Ports specified in the HOLD section in the configuration file are protected from deinstallation.
114 This functionality is intended to avoid manually deinstalled conflict ports or ports whose build or installation operations can damage the system, e.g., by flooding the file systems or kernel panic.
115 This command is for temporal definitions and permanent definitions should be given as TABOO_* values in ${LOCALBASE}/etc/portsreinstall.conf instead.
116 .TP
117 \fBtaboo del\fR \fIglob1\fR [\fIglob2\fR ...]
118 Deregister taboo ports.
119 The port globs are separated from each other by comma or space.
120 .TP
121 \fBfreeze add\fR \fIglob1\fR [\fIglob2\fR ...]
122 Register ports to freeze that must not be built but the package installtion by any available version may be safe.
123 If the specified ports failed to (re)install by packages, build of their dependents are also suppressed.
124 The port globs are separated from each other by comma or space.
125 This functionality is intended to build of ports which can damage the system, e.g., by flooding the file systems or kernel panic, while their installed packages will not be harmful.
126 This command is for temporal definitions and permanent definitions should be given as FREEZE_* values in ${LOCALBASE}/etc/portsreinstall.conf instead.
127 .TP
128 \fBfreeze del\fR \fIglob1\fR [\fIglob2\fR ...]
129 Deregister ports to freeze.
130 The port globs are separated from each other by comma or space.
131 .TP
132 \fBneed add\fR \fIglob1\fR [\fIglob2\fR ...]
133 Register necessary ports that should be newly installed if not yet and kept installed even if being obsolete.
134 The port globs are separated from each other by comma or space.
135 Registration to be "necessary" takes priority over "unnecessary" registered by \fBnoneed add\fR command.
136 In other words, the registered ports are excluded from deinstallation candidates if they are obsolete, leaf or not-initially-installed ports, and otherwise have no effect on the actual operations.
137 .TP
138 \fBneed del\fR \fIglob1\fR [\fIglob2\fR ...]
139 Deregister necessary ports.
140 The port globs are separated from each other by comma or space.
141 The deregistered ports are added to leaf port candidates if they are not initially installed.
142 In this case, information on the deregistered ports remain until removal by \fBforget\fR command.
143 .TP
144 \fBnoneed add\fR \fIglob1\fR [\fIglob2\fR ...]
145 Register unnecessary ports that should be deinstalled unless required by other non\-leaf ports.
146 The port globs are separated from each other by comma or space.
147 In other words, the registered ports are added to leaf ports if they have no non\-leaf dependent, and otherwise have no effect on the actual operations.
148 Requirements of the registered ports are also recognized as leaves if all of their dependents are leaves.
149 Ports specified in the HOLD section in the configuration file are protected.
150 For example, just after installing new ports due to \fBneed add\fR command or \fB\-i\fR option as requirements of a specified target, registering only the target will let the all required ports be leaves as well as the target.
151 Actually deinstalled ports are selected via dialog together with the original leaf ports.
152 .TP
153 \fBnoneed del\fR \fIglob1\fR [\fIglob2\fR ...]
154 Deregister unnecessary ports.
155 The port globs are separated from each other by comma or space.
156 .TP
157 \fBreselect leaves\fR
158 Reselect leaf ports to delete.
159 This command is effective only after the temporary database is once built.
160 .TP
161 \fBreselect obsolete\fR
162 Reselect obsolete ports to delete.
163 This command is effective only after the temporary database is once built.
164 .TP
165 \fBsave\fR [\fIdir\fR]
166 Save the current temporary database as a .tar.gz archive.
167 The file name is created automatically by containing the current date time.
168 By default save directory is the current directory.
169 .TP
170 \fBload\fR \fIpath\fR
171 Load a temporary database archive.
172 Note that the currently temporary database is removed.
173 .TP
174 \fBglob\fR \fIglob\fR [\fIglob2\fR ...]
175 Evaluate port globs and show matched flavored origins both for installed and uninstalled packages.
176 .TP
177 \fBoptions\fR
178 Show saved option settings and expected effects of option-resetting options \fB\-L\fR, \fB\-M\fR and \fB\-N\fR.
179 With \fB\-a\fR option, the first, second and third columns denote the option-resetting options, reset options and remaining options, respectively.
180 .TP
181 \fBrmconf\fR \fIglob\fR [\fIglob2\fR ...]
182 Reset port options for the specified ports to the default and reset affected parts in the temporary database.
183 .TP
184 \fBreconf\fR \fIglob\fR [\fIglob2\fR ...]
185 Reconfigure port options for the specified ports.
186 The specified ports are re-inspected even when the options are unchanged or undefined.
187 All affected ports are inspected again in the following runs by \fBdo\fR or \fBredo\fR command.
188 .TP
189 \fBforget\fR \fIglob\fR [\fIglob2\fR ...]
190 Try to let the temporary database forget about the specified ports as much as possible.
191 Concretely, the data on each of the specified ports and their requirements/dependents is unless initially installed or required by other preserved ports.
192 This command is mainly for removing information on ports which had been added due to \fB\-i\fR option or \fBneed add\fR command but have become unneeded again.
193 In advance to executing this command, deinstallation for the specified ports should be completed by \fBnoneed add\fR command followed by \fBredo\fR command.
194 It is noted that ports registered by \fBok\fR, \fBtaboo\fR, \fBfreeze\fR and \fBnoneed\fR commands are NOT deleted.
195 Internal tables used for \fBshow\fR command keep their information regardless of this command.
196 .TP
197 \fBpkgsanity\fR [\fIglob\fR ...]
198 Examine the sanity of installed packages, i.e., whether the installed files exist and match the checksum.
199 If arguments \fIglobs\fR are given, only the matching packages are examined.
200 For each insane package, the user is queried whether to reinstall it forcedly in the following do/redo runs.
201 The default choice is "yes" for packages which have any ELF binaries or include files changed or any type of files overwritten by other packages, and "no" for the others.
202 Insane packages already assigned to be reinstalled are skipped.
203 With \fB\-a\fR enabled, all insane packages are assigned to be the above mentioned default and the output is given in a form that the first to fourth columns denote the package name, flavored port origin, whether assigned to be reinstalled (yes or no), and file path with a notice, respectively.
204 It is noted that this sanity check can detect some configuration or cache files which are changed during normal use and need not to be recovered.
205 .TP
206 \fBescape\fR \fIglob\fR [\fIglob2\fR ...]
207 Back up and delete packages specified by \fIglobs\fR for a temporary escape mainly for resolving undeclared conflicts.
208 The escaped packages are registered as taboo as same as \fBtaboo add\fR \fIglob\fR [\fIglob2\fR ...].
209 .TP
210 \fBrestore\fR \fIglob\fR [\fIglob2\fR ...]
211 Restore packages specified by \fIglobs\fR escaped by \fBescape\fR command.
212 The escaped packages are deregistered from taboo as same as \fBtaboo del\fR \fIglob\fR [\fIglob2\fR ...].
213 .TP
214 \fBpackupgrade\fR \fBcreate\fR
215 Create packages of the all reinstalled or newly installed ports (at a "builder" environment) with a set of scripts for upgrading another system with the same initial configuration of installed packages ("target" environment).
216 One of typical examples of application can be such that the builder is a "forked" jail/chroot system constructed onto a host system by using nullfs and unionfs and the target is the host system (Refer to "Package build in a chroot system" Section).
217 Another typical example can be such that the builder is one node of a cluster system and the targets are the other nodes.
218 If the execution is terminated before completion, it can be restarted from the terminated point by re-running this command.
219 The created packages are saved at ${PACKAGES}/${PKGREPOSITORYSUBDIR}, which is usually /usr/ports/packages/All.
220 In order to crop the created set of scripts, \fBpackupgrade\fR \fBcrop\fR command must be executed.
221 .TP
222 \fBpackupgrade\fR \fBcrop\fR [\fIpath\fR]
223 Crop the created set of scripts as a tar.gz archive, where its path name is specified by \fIpath\fR argument (if \fIpath\fR is a directory, the file name is set to "portsreinstall-upgrade.tar.gz"; the default of \fIpath\fR is the current directory).
224 This command must be executed after completion of \fBpackupgrade\fR \fBcreate\fR command.
225 The obtained archive is to be conveyed to the target together with the created packages.
226 Then "portsreinstall-upgrade.sh" obtained by extracting the archive is to be run at the target.
227 .TP
228 \fBpackupgrade\fR \fBclean\fR
229 Reset the execution progress of \fBpackupgrade\fR \fBcreate\fR command and discard the internally saved created set of scripts.
230 This does not affect any already cropped sets of scripts or created packages.
231 This command is provided for cases that ports/packages are reinstalled or reconfigured during/after the execution of \fBpackupgrade\fR \fBcreate\fR command.
232 After execution of this command, \fBpackupgrade\fR \fBcreate\fR command will overwrite the packages by creating them again.
233 .TP
234 \fBshow\fR [\fIsubject\fR] [@[\fBrun\fR|\fBbuild\fR|\fBall\fR][,[\fBdirect\fR|\fBfull\fR]]] [\fIarguments\fR]
235 Show the list of ports to be reinstalled.
236 The applied scope of dependencies can be controlled by "show option" proceeded by "@"; \fBrun\fR, \fBbuild\fR and \fBall\fR employ the run\-time, build\-time or both-time ones, respectively; \fBdirect\fR and \fBfull\fR include only the direct or fully recursive ones, respectively.
237 The default scope is determined by the saved option settings for \fB\-B\fR, \fB\-b\fR and \fB\-o\fR.
238 Some \fIsubject\fR's require \fIarguments\fR.
239 The following \fIsubject\fR's are available.
240 .RS 8
241 .TP
242 \fBtodo\fR
243 Ports to be reinstalled in the current do/redo process (default).
244 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
245 .TP
246 \fBdone\fR
247 Ports which have been already reinstalled to be up-to-date with their all requirements.
248 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
249 .TP
250 \fBresolved\fR
251 Manually reinstalled ports registered by \fBok\fR command.
252 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
253 .TP
254 \fBfailure\fR
255 Failed ports.
256 With \fB\-a\fR option, the first, second and third columns denote the flavored origin, initial/new/current package name, failed make target and manually resolved status (yes or no), respectively.
257 .TP
258 \fBredo\fR
259 Ports to be reinstalled after success in any of their failed requirements.
260 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
261 .TP
262 \fBtaboo\fR
263 Taboo ports registered by \fBtaboo\fR command.
264 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
265 .TP
266 \fBfreeze\fR
267 Taboo ports registered by \fBfreeze\fR command.
268 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
269 .TP
270 \fBneed\fR
271 Necessary ports registered by \fBneed\fR command.
272 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
273 .TP
274 \fBnoneed\fR
275 Unnecessary ports registered by \fBnoneed\fR command.
276 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
277 .TP
278 \fBrestored\fR
279 Leaf, obsolete or unneeded ports which had been once deleted but are to be or have been restored.
280 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
281 .TP
282 \fBdeleted\fR
283 Leaf, obsolete or unneeded ports are to be or have been deleted.
284 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
285 .TP
286 \fBconflict\fR
287 Conflicting ports which are temporarily deleted.
288 With \fB\-a\fR option, the first, second and third columns denote the flavored origin, initial/new/current package name, and opponent ports concatenated by comma respectively.
289 .TP
290 \fBleaves\fR [\fBselected\fR | \fBunselected\fR]
291 All detected leaf ports.
292 Keywords \fBselected\fR and \fBunselected\fR are for filtering only selected (to be deleted) and unselected (to be preserved) ones, respectively.
293 With \fB\-a\fR option, the first, second and third columns denote the flavored origin, initial/new/current package name, and opponent ports concatenated by comma respectively.
294 .TP
295 \fBobsolete\fR [\fBselected\fR | \fBunselected\fR]
296 All detected obsolete ports.
297 Keywords \fBselected\fR and \fBunselected\fR are for filtering only selected (to be deleted) and unselected (to be preserved) ones, respectively.
298 With \fB\-a\fR option, the first, second and third columns denote the flavored origin, initial/new/current package name, and opponent ports concatenated by comma respectively.
299 .TP
300 \fBrequirements\fR \fIglob1\fR [\fIglob2\fR ...]
301 Ports required by matching ports/packages.
302 With \fB\-a\fR option, the first, second, third and fourth columns denote the flavored origin of the queried port, initial/new/current package name of the queried port, flavored origin of a requirement of the queried port and initial/new/current package name of the requirement, respectively.
303 .TP
304 \fBdependents\fR \fIglob1\fR [\fIglob2\fR ...]
305 Ports depending on matching ports/packages.
306 With \fB\-a\fR option, the first, second, third and fourth columns denote the flavored origin of the queried port, initial/new/current package name of the queried port, flavored origin of a dependent of the queried port and initial/new/current package name of the dependent, respectively.
307 .TP
308 \fBinitrequirements\fR \fIglob1\fR [\fIglob2\fR ...]
309 Ports initially required by matching initially installed ports/packages.
310 With \fB\-a\fR option, the first, second, third and fourth columns denote the flavored origin of the queried port, package name of the queried port, flavored origin of a requirement of the queried port and package name of the requirement, respectively.
311 .TP
312 \fBinitdependents\fR \fIglob1\fR [\fIglob2\fR ...]
313 Ports initially depending on matching initially installed ports/packages.
314 With \fB\-a\fR option, the first, second, third and fourth columns denote the flavored origin of the queried port, package name of the queried port, flavored origin of a dependent of the queried port and package name of the dependent, respectively.
315 .TP
316 \fBconflict_files\fR \fIglob1\fR [\fIglob2\fR ...]
317 Possible additional conflict files of matching ports/packages.
318 The first and second columns denote the possible conflict package and file path, respectively.
319 For officially registered conflict, nothing is outputted.
320 In other words, if something is outputted, the port Makefile can have some defect or the custom modification of the system can be confusing the port or the conflicting packages.
321 .TP
322 \fBstatus\fR \fIglob1\fR [\fIglob2\fR ...]
323 Current success/failure status in (re)installation of matching ports/packages.
324 Returned values are null, "todo", "done", "resolved", "failure", "redo", "taboo", "freeze", "need", "noneed", "restored", "deleted" or "conflict", where null means that they are untouched in the current option configuration or temporary reset due to configuration changes. 
325 .TP
326         \fBerrormessage\fR \fIglob1\fR [\fIglob2\fR ...]
327 Error message in (re)installation of matching ports/packages.
328 Returned values are null for successful or skipped ports/packages. 
329 .RE
330 .SH OPTIONS
331 If duplicated or conflicting ones are set, the last ones are effective.
332 The end of options can be explicitly specified by \fB\-\-\fR.
333 Short options can be given in compact forms, for example, \fB\-i -q -P\fR to be \fB\-iqP\fR.
334 .PD
335 .TP
336 \fB*NOTE*\fR
337 The configuration of options annotated as "saved and transferred to restarted/following runs" are saved in the temporary database by the first run after cleaning the database.
338 In the following runs for any commands, the corresponding option settings are loaded from the saved configuration unless explicitly reset by \fB\-L\fR, \fB\-M\fR or \fB\-N\fR option.
339 The saved options can be checked by \fBportsreinstall options\fR command.
340 .PD
341 .SS Group 1: Just show messages and exit without operation
342 .IP \fB\-H\fR
343 .PD 0
344 .TP
345 \fB\-\-long\-help\fR
346 Show a long help whose content is the same as the manual page.
347 .PD
348 .IP \fB\-h\fR
349 .PD 0
350 .TP
351 \fB\-\-help\fR
352 .PD 0
353 .TP
354 \fB\-\-short\-help\fR
355 Show a short help.
356 .PD
357 .IP \fB\-V\fR
358 .PD 0
359 .TP
360 \fB\-\-show\-version\fR
361 Show the current version.
362 .PD
363 .SS Group 2: Effective anytime
364 .IP \fB\-a\fR
365 .PD 0
366 .TP
367 \fB\-\-batch\-mode\fR
368 Suppress messages so as to be friendly for batch operations.
369 The output formats for \fBoptions\fR and \fBshow\fR commands and \fB\-V\fR option are arranged to be more batch\-friendly.
370 It is noted that log output in build/installation processes are not suppressed.
371 .PD
372 .IP \fB\-i\fR
373 .PD 0
374 .TP
375 \fB\-\-allow\-new\-targets\fR
376 Allow \fB\-O\fR, \fB\-T\fR or \fB\-t\fR options to specify not\-yet\-installed ports.
377 If any of not\-yet\-installed ports matching the target globs are ambiguous, a dialog box is open for each of them to select the actual targets.
378 .PD
379 .IP \fB\-M\fR
380 .PD 0
381 .TP
382 \fB\-\-reset\-minor\-options\fR
383 Reset option settings for minor controls.
384 Option settings for group 4 are once reset and replaced with the newly specified ones.
385 Check the saved options by \fBportsreinstall options\fR command before specifying this option.
386 .PD
387 .IP \fB\-S\fR
388 .PD 0
389 .TP
390 \fB\-\-no\-opening\-message\fR
391 Suppress the credit and opening messages.
392 Option \fB\-a\fR takes higher priority over this option.
393 .PD
394 .SS Group 3: Effective only with redo command
395 .IP \fB\-L\fR
396 .PD 0
397 .TP
398 \fB\-\-reload\-conf\fR
399 Reload configuration files.
400 This option is effective only with \fBredo\fR command.
401 Option settings for group 6 are once reset and replaced with the newly specified ones.
402 Check the saved options by \fBportsreinstall options\fR command before specifying this option.
403 .PD
404 .IP \fB\-N\fR
405 .PD 0
406 .TP
407 \fB\-\-reset\-targets\fR
408 Re\-scan installed packages and reset option settings for target specification.
409 This option is effective only with \fBredo\fR command.
410 Option settings for group 5 are once reset and replaced with the newly specified ones.
411 Check the saved options by \fBportsreinstall options\fR command before specifying this option.
412 .PD
413 .SS Group 4: Saved and transferred to restarted runs, renewable by \-M option
414 Option settings in this group are saved at the first \fBdo\fR or \fBprepare\fR run, and transferred to the following runs.
415 Reset of the saved values for this group is available by appending \fB\-M\fR with newly specified options.
416 .IP \fB\-A\fR
417 .PD 0
418 .TP
419 \fB\-\-non\-interactive\-ports\-only\fR
420 Operations of (re)installation are made only on ports which do not require manual interaction.
421 This option conflicts with \fB\-I\fR.
422 .PD
423 .IP \fB\-B\fR
424 .PD 0
425 .TP
426 \fB\-\-exclude\-runtime\-dependencies\fR
427 Exclude run\-time dependencies in evaluation of dependencies.
428 This option affects behaviors of \fB\-t\fR, \fB\-T\fR and \fB\-q\fR options.
429 .PD
430 .IP \fB\-b\fR
431 .PD 0
432 .TP
433 \fB\-\-include\-buildtime\-dependencies\fR
434 Include build\-time dependencies in evaluation of dependencies.
435 This option affects behaviors of \fB\-t\fR, \fB\-T\fR and \fB\-q\fR options.
436 .PD
437 .IP \fB\-C\fR
438 .PD 0
439 .TP
440 \fB\-\-apply\-default\-config\fR
441 The temporary database is built by skipping executing \fBmake config\-conditional\fR so that the port options are unchanged.
442 The default values are applied to unconfigured port options.
443 The port options are unchanged and unsaved (they are saved in case of old ports trees in which \fBdialog\fR(1) is used instead of \fBdialog4ports\fR(1)).
444 .PD
445 .IP \fB\-c\fR
446 .PD 0
447 .TP
448 \fB\-\-suppress\-cleaning\-obsolete\-database\fR
449 Suppress cleaning the temporary database even if its obsolete.
450 This option suppresses the default behavior that the temporary database is automatically cleaned up if it is older than the ports tree or portsreinstall itself is to be upgraded.
451 Use of this option may cause unexpected results and basically unrecommended.
452 .PD
453 .IP \fB\-D\fR
454 .PD 0
455 .TP
456 \fB\-\-suppress\-entire\-inspection\-distinfo\fR
457 Suppress entire inspection of distinfo files in the ports tree as a preparation for deleting obsolete distfiles.
458 By default, viz., without this option, all distfiles are preserved unless being obsolete in the current version of the ports tree.
459 For this purpose, entire inspection of distinfo files in the ports tree is carried out in order to get the complete list of distfiles.
460 This inspection can take an extremely long time if the ports tree is located in file systems with low access speeds.
461 With this option specified, distfiles for ports are deleted unless they are initially installed, added due to \fB\-i\fR option, or required by any of the installed or added ports.
462 .PD
463 .IP \fB\-d\fR
464 .PD 0
465 .TP
466 \fB\-\-keep\-distfiles\fR
467 Do not clean up obsolete or unused distfiles.
468 .PD
469 .IP \fB\-F\fR
470 .PD 0
471 .TP
472 \fB\-\-fetch\-only\fR
473 Execute fetch and checksum verification only at the (re)installation process for each port.
474 Packages are also fetched if applicable.
475 Regardless of this mode, missing essential tools for package management such as \fBpkg\fR(8) and \fBdialog4ports\fR(1) will be installed.
476 .PD
477 .IP \fB\-f\fR
478 .PD 0
479 .TP
480 \fB\-\-disallow\-force\-continuation\-for\-looped\-dependency\fR
481 Disallow forcible continuation in case that looped dependencies are found.
482 Without this option, workarounds are carried out at the phase of "Completion of *-time requirement lists" of the preparation stage.
483 In this case, when a looped dependency is detected, the first found dependency which is not run-and-build-time dependency (that is a typical pattern of dynamically linked libraries) is marked ignored to break the loop; if no such dependency is found, one connecting the end back to the start of a loop cycle is ignored for the time being.
484 .PD
485 .IP \fB\-G\fR
486 .PD 0
487 .TP
488 \fB\-\-use\-prebuilt\-package\fR
489 Use prebuilt packages for ports with the default configurations, i.e., in which and in the all required ports of which no port option is changed from the default and no knob (make environment variable or make argument) or replacement is defined in${LOCALBASE}/etc/portsreinstall.conf .
490 As long as no knob is defined in /etc/make.conf and no environment variable has effect on package builds, this option will accelerate the (re)installtion processes without harm.
491 It is noted that some ports still may be problematic with this assumption by automatic dependencies on other system configurations.
492 This problem can be resolved by configuring NOPKG_* section in ${LOCALBASE}/etc/portsreinstall.conf.
493 .RS
494 Historical background:
495 The actual merit of this option depended on the service levels and qualities of the remote package sites; since October 31, 2013, weekly-updated pkgng packages were provided for major architectures (at November 15, 2013, i386 and amd64 only) until their end-of-life while legacy packages were provided only at each release timing; the situations were different for STABLE and CURRENT versions and more various architectures were supported for legacy packages.
496 The official support of legacy packages were abandoned at September 1, 2014, but third-party services might be used by configuring PACKAGECHECKSUMROOTS and PACKAGEROOTS if available somewhere.
497 .RE
498 .PD
499 .IP \fB\-g\fR
500 .PD 0
501 .TP
502 \fB\-\-suppress\-pkgtools\-upadte\fR
503 Keep indispensable packages for the standard function of the ports/packages system untouched.
504 Concretely, this option suppresses upgrade, de/re-installation of the currently installed ports-mgmt/pkg(\-devel) and ports-mgmt/dialog4ports.
505 .PD
506 .IP \fB\-I\fR
507 .PD 0
508 .TP
509 \fB\-\-interactive\-ports\-only\fR
510 Operations of (re)installation are made only on ports which require manual interaction.
511 This option conflicts with \fB\-A\fR.
512 .PD
513 .IP \fB\-k\fR
514 .PD 0
515 .TP
516 \fB\-\-suppress\-self\-upadte\fR
517 Keep portsreinstall itself untouched.
518 This option suppresses upgrade, deinstallation and reinstallation of the currently installed portsreinstall.
519 .PD
520 .IP \fB\-l\fR
521 .PD 0
522 .TP
523 \fB\-use\-legacy\-package\-for\-missing\-pkgng\fR
524 If prebuilt modern-style packages are missing, use of corresponding legacy ones is attempted instead by converting them to the modern-style using \fBpkg2ng\fR.
525 This option is effective only when \fB\-G\fR option is enabled and the modern-style is employed for the current packages system, but will not be harmful even in the other cases.
526 .PD
527 .IP \fB\-n\fR
528 .PD 0
529 .TP
530 \fB\-\-dry\-run\fR
531 No operation is carried out (just for seeing what will be done).
532 This option is effective for \fBdo\fR and \fBredo\fR commands so that no deinstallation and (re)installation process is actually carried out.
533 By this option, ports/packages to be deinstalled or (re)installed can be confirmed without making changes to the current situation of packages.
534 .PD
535 .IP \fB\-q\fR
536 .PD 0
537 .TP
538 \fB\-\-skip\-unchanged\-ports\fR
539 Only new ports and their dependents are reinstalled.
540 This option is convenient when the all of the major version of the system and configurations of ports (options and knobs) are unchanged.
541 The behavior can be modified by \fB\-b\fR option.
542 .PD
543 .IP \fB\-s\fR
544 .PD 0
545 .TP
546 \fB\-\-avoid\-vulnerability\-check\fR
547 Build of vulnerable ports are avoided by triggering errors.
548 Note that already installed vulnerable packages are untouched.
549 If you desire to uninstall them, do it manually.
550 .PD
551 .IP \fB\-X\fR
552 .PD 0
553 .TP
554 \fB\-\-deselect\-all\fR
555 Automatically deselect all candidates for deinstallation of leaf or obsolete ports.
556 This option conflicts with \fB\-Y\fR option.
557 .PD
558 .IP \fB\-x\fR
559 .PD 0
560 .TP
561 \fB\-\-no\-exec\-inst\-script\fR
562 Execution of scripts in pre-installation, post-installation and deinstallation defined for each package is skipped.
563 This option is suitable for package build in \fBportsreinstall\-chroot\fR(8) or other change-rooted/jailed environment.
564 .PD
565 .IP \fB\-Y\fR
566 .PD 0
567 .TP
568 \fB\-\-select\-all\fR
569 Automatically select all candidates for deinstallation of leaf or obsolete ports.
570 This option conflicts with \fB\-X\fR option.
571 .PD
572 .SS Group 5: Saved and transferred to restarted runs, renewable by \-N option
573 Option settings in this group are saved at the first \fBdo\fR or \fBprepare\fR run, and transferred to the following runs.
574 Reset of the saved values for this group is available in the initial run of \fBredo\fR command by appending \fB\-N\fR with newly specified options.
575 .IP \fB\-O\fR\ \fIglob1\fR[\fB:\fIglob2\fR[\fB:\fR...]]
576 .PD 0
577 .TP
578 \fB\-\-target\-only\-itself=\fR\fIglob1\fR[\fB:\fIglob2\fR[\fB:\fR...]]
579 Restrict (re/de)installation within a scope consisting of the specified target ports and their missing build\-time requirements.
580 Available ports matching the specified target globs are automatically registered as necessary ports equivalently to \fBportsreinstall need add\fR command.
581 Records of successful (re)installation for the all ports in the scope are deleted so that they are to be reinstalled forcedly.
582 So this option is usable for fixing packages whose data in the package database or content files are broken.  
583 Without \fB\-i\fR option, target ports must be already installed or inspected.
584 Without \fB\-o\fR option, the temporary database is maintained to have complete data on dependencies of all installed and necessary ports.
585 Combination with options \fB\-T\fR and \fB\-t\fR is available.
586 The behavior can be modified by \fB\-B\fR, \fB\-b\fR, \fB\-i\fR and \fB\-o\fR options.
587 .PD
588 .IP \fB\-o\fR
589 .PD 0
590 .TP
591 \fB\-\-only\-target\-scope\fR
592 Ignore ports which are outside of target scopes of \fB\-O\fR, \fB\-T\fR or \fB\-t\fR options.
593 Inspection of dependencies is made within the least-required scope for (re)installing the targets.
594 If given with \fB\-O\fR, targets themselves and their missing direct build\-time requirements are in the scope.
595 If given with \fB\-T\fR, targets themselves, their direct requirements and their missing direct build\-time requirements are in the scope.
596 If given with \fB\-t\fR, targets themselves, their already-inspected dependents and their missing direct build\-time requirements are in the scope.
597 Ports outside of the scopes are kept untouched even if they are updated.
598 It is noted that this option disables detection and deinstallation of new leaf ports.
599 This option will be useful for quick upgrades or new installation (only) before complete construction of the temporary database for the all installed ports.
600 .PD
601 .IP \fB\-T\fR\ \fIglob1\fR[\fB:\fIglob2\fR[\fB:\fR...]]
602 .PD 0
603 .TP
604 \fB\-\-target\-and\-requirements=\fR\fIglob1\fR[\fB:\fIglob2\fR[\fB:\fR...]]
605 Restrict (re/de)installation within a scope consisting of the specified target ports, their requirements and their missing build\-time requirements.
606 Available ports matching the specified target globs are automatically registered as necessary ports equivalently to \fBportsreinstall need add\fR command.
607 Records of successful (re)installation for the all ports in the scope are deleted so that they are to be reinstalled forcedly.
608 So this option is usable for fixing packages whose data in the package database or content files are broken.  
609 Without \fB\-i\fR option, target ports must be already installed or inspected.
610 Without \fB\-o\fR option, the temporary database is maintained to have complete data on dependencies of all installed and necessary ports.
611 Combination with options \fB\-T\fR and \fB\-t\fR is available.
612 The behavior can be modified by \fB\-B\fR, \fB\-b\fR, \fB\-i\fR and \fB\-o\fR options.
613 .PD
614 .IP \fB\-t\fR\ \fIglob1\fR[\fB:\fIglob2\fR[\fB:\fR...]]
615 .PD 0
616 .TP
617 \fB\-\-target\-and\-dependents=\fR\fIglob1\fR[\fB:\fIglob2\fR[\fB:\fR...]]
618 Restrict (re/de)installation within a scope consisting of the specified target ports, their dependents and their missing build\-time requirements.
619 Available ports matching the specified target globs are automatically registered as necessary ports equivalently to \fBportsreinstall need add\fR command.
620 Records of successful (re)installation for the all ports in the scope are deleted so that they are to be reinstalled forcedly.
621 So this option is usable for fixing packages whose data in the package database or content files are broken.  
622 Without \fB\-i\fR option, target ports must be already installed or inspected.
623 Without \fB\-o\fR option, the temporary database is maintained to have complete data on dependencies of all installed and necessary ports.
624 Combination with options \fB\-T\fR and \fB\-t\fR is available.
625 The behavior can be modified by \fB\-B\fR, \fB\-b\fR, \fB\-i\fR and \fB\-o\fR options.
626 .PD
627 .SS Group 6: Saved and transferred to restarted runs, renewable by \-L option
628 Option settings in this group are saved at the first \fBdo\fR or \fBprepare\fR run, and transferred to the following runs.
629 Reset of the saved values for this group is available in the initial run of \fBredo\fR command by appending \fB\-L\fR with newly specified options.
630 .IP \fB\-P\fR
631 .PD 0
632 .TP
633 \fB\-\-load\-pkgtoolsconf\-as\-override\fR
634 Import settings from \fBpkgtools.conf\fR(5) as the secondary.
635 This option is effective only when \fBportupgrade\fR(1) is installed.
636 For duplicated configurations, values in portsreinstall.conf are applied first and then those in \fBpkgtools.conf\fR(5) are.
637 This option overrides preceding \fB\-p\fR option. 
638 .PD
639 .IP \fB\-p\fR
640 .PD 0
641 .TP
642 \fB\-\-load\-pkgtoolsconf\-as\-default\fR
643 Import settings from \fBpkgtools.conf\fR(5) as the primary (default).
644 This option is effective only when \fBportupgrade\fR(1) is installed.
645 For duplicated configurations, values in \fBpkgtools.conf\fR(5) are applied first and then those in portsreinstall.conf are.
646 This option overrides preceding \fB\-P\fR option. 
647 .PD
648 .IP \fB\-Q\fR
649 .PD 0
650 .TP
651 \fB\-\-ignore\-pkgtoolsconf\fR
652 Ignore \fBpkgtools.conf\fR(5) even if it exists.
653 .PD
654 .SH DETAILS
655 .SS Overview
656 This utility is a ports/packages management tool which upgrades packages to be as much as consistent regarding their dependencies by allowing repetitional retrials called "redo runs".
657 The implementation of this utility is designed for smart entire reinstallation of installed packages which takes a very long time.
658 A temporary database is used for managing the starting point, intermediate status and goal of the upgrade processes.
659 The starting point is determined by the initially installed packages.
660 The intermediate status contains various information on successes and failures of ports to judge the necessity of upgrade considering dependencies during \fBredo\fR runs.
661 The goal is determined by the ports tree, replacement to compatible ports and configurations for each port, i.e., port options configured by \fBmake config\fR and knobs (make environment variables and make arguments).
662 In order to make this utility work smartly, knob should be defined in ${LOCALBASE}/etc/portsreinstall.conf (or \fBpkgtools.conf\fR(5) if \fBportupgrade\fR(1) is installed) but not in /etc/make.conf
663 The temporary database is available until the ports tree is updated.
664 Each port is built for its (re)installation in principle, however, \fB\-G\fR option enables a function that use of prebuilt packages in remote servers are attempted for each port matching a condition that all configurations of the port and its requirements are unchanged from the default.
665 .PP
666 The algorithms of this utility are originally optimized for massive reinstallation to be invoked after major upgrade of the system where reinstallation of all third\-party applications is encouraged before cleaning up obsolete system libraries.
667 Nevertheless, the all functionalities of this utility is applicable to any situations where complete reinstallation is preferred for the whole or typical packages, e.g., when you have been lazy in upgrade of ports for a too long time.
668 .PP
669 In a standard case, the entire reinstallation will proceed in the following step:
670 .TP
671 1.
672 Update the ports tree and (except in case of the legacy package system) the \fBpkg\fR(8) repository catalog;
673 .PD
674 .TP
675 2.
676 Clean up a temporary database which stores the all information used for the whole task of reinstallation (first \fBdo\fR or \fBprepare\fR run);
677 .PD
678 .TP
679 3.
680 Record the snapshot of the all installed packages as the initial point of reinstallation (first \fBdo\fR or \fBprepare\fR run);
681 .PD
682 .TP
683 4.
684 Build up the database to store data on configurations and dependencies (which may depend on the configurations) of the all (re/de)installing packages to be the latest version according to the current ports tree (\fBdo\fR or \fBprepare\fR run);
685 .PD
686 .TP
687 5.
688 Select obsolete packages or new leaf ports/packages to deinstall or exclude if any (\fBdo\fR or \fBprepare\fR run);
689 .PD
690 .TP
691 6.
692 Execute the actual (re/de)installation (\fBdo\fR run);
693 .PD
694 .TP
695 7.
696 If some ports failed, attempt manual troubleshooting by make modification to the temporary database or manually re/de-install packages in concern (\fBok\fR, \fBtaboo\fR, \fBfreeze\fR, \fBnoneed\fR, \fBreconf\fR, etc.).
697 .PD
698 .TP
699 8.
700 Execute the retrial of the (re/de)installation (\fBredo\fR run);
701 .PD
702 .TP
703 9.
704 Repeat from 7 to 8 until the all available ports succeed.
705 .PD
706 .PP
707 A typical instance of actually executed commands for upgrading packages will be in the following flow:
708 .TP
709 1.
710 .B portsnap fetch update
711 .PD
712 .TP
713 2.
714 .B pkg update
715 .RS
716 (No need for the legacy packages system)
717 .RE
718 .PD
719 .TP
720 3.
721 .B script
722 .RS
723 (Enter \fBscript\fR(1) environment for logging)
724 .RE
725 .PD
726 .TP
727 4.
728 .B portsreinstall
729 .RS
730 (Possibly end up with some failed ports)
731 .RE
732 .PD
733 .TP
734 5.
735  ... Countermeasure to failures ...
736 .PD
737 .TP
738 6.
739 .B portsreinstall redo
740 .RS
741 (Possibly end up with some failed ports)
742 .RE
743 .PD
744 .TP
745 7.
746  ... Repetition from 6 to 7 ...
747 .PD
748 .TP
749 8.
750 .B portsreinstall redo
751 .RS
752 (All available ports succeed)
753 .RE
754 .PD
755 .PP
756 Here, in case of entire reinstallation after a major version upgrade of the operating system, \fB\-q\fR option should be removed.
757 It is usually encouraged to execute the command on \fBscript\fR(1) in order to record the make outputs for catching reasons of failures if any.
758 In many cases, the user may undergo failures in build or installation of some ports during do/redo runs.
759 Refer to subsections entitled "Workaround for failed ports: ..." for the techniques and procedures to resolve the problems.
760 .PP
761 This utility is implemented to be flexible and robust about interrupt/restart operations so as to allow the users to run only when the machine is free and terminate when it becomes busy on demand.
762 Concretely, the users can stop the process by CTRL+C (or even by unexpected termination) and restart from the stopped point at any stage throughout the whole task, i.e., from the beginning of preparation of the temporary database to the end of (re/de)installation.
763 This functionality allows the users, for example, to start this utility before lunch, terminate after lunch, restart before dinner, terminate after dinner, restart before going to bed, terminate after breakfast, restart before lunch, ..., and finally complete.
764 .PP
765 Compatibility with \fBportupgrade\fR(1) is well considered if it is installed; settings in \fBpkgtools.conf\fR(5) are reflected and the portupgrade database is updated at the end of each do/redo run.
766 The main difference of this utility with \fBportupgrade\fR(1) or \fBportmaster\fR(8) is that this utility is optimized for on\-the\-fly entire upgrade of the packages environment to be as complete as possible while the latter are for partial upgrade to get the latest versions available as quickly as possible by applying the least "patches" to the environment.
767 While this utility also has options for partial upgrade (\fB\-t\fR, \fB\-T\fR and \fB\-O\fR), they are intended as auxiliary modification of (re)installing packages.
768 This utility resolves conflicts between old and new packages automatically by referring to CONFLICTS, CONFLICTS_BUILD and CONFLICTS_INSTALL defined for each port or by redo processes for ports missing appropriate definition of them.
769 Many of the UPDATING advisories on trouble shooting in packages upgrade will be unnecessary to follow if the users use this utility instead of \fBportupgrade\fR(1) or \fBportmaster\fR(8).
770 .PP
771 If this utility has been installed by ports/packages and the corresponding port is renewed, upgrade of this utility is carried out first and then the following processes are continued by the new version after cleaning up the temporary database.
772 .PP
773 New leaf ports (primary leaves) and their exclusive requirements (secondary leaves) are automatically detected.
774 The user may specify unneeded ports explicitly by \fBportsreinstall noneed\fR command so that the specified ports are added to the new leaves if they have no non-leaf dependents.
775 If any leaf ports are detected, the user is prompted to select ones to delete by dialog.
776 Similarly, obsolete ports to delete are also selectable by dialog.
777 Here, both for leaf and obsolete ports, the selection can be modified afterward and unselected ones can be restored by following redo runs.
778 .PP
779 The scheme of this utility is divided into stages of temporary database construction and actual (re/de)installation.
780 Execution by
781 .B portsreinstall prepare
782 procedes to the end the first stage, and that without any argument procedes to the end of the second stage.
783 Each of these two major stages is divided into minor stages.
784 When a previously terminated process is restarted, completed minor stages are skipped.
785 Changes of the configurations made or notified by corresponding options or commands of this utility are reflected to the database by automatically re-executing the concerned stages in the following do/redo runs.
786 .PP
787 When option(s) \fB\-O\fR, \fB\-t\fR or \fB\-T\fR is/are specified, only the targets and their requirements or dependents within the specified scope are inspected and (re/de)installed.
788 Inspected data on the ports are preserved in the temporary database and reused in the following runs even if the targets are reset or changed with aid of \fB\-N\fR option.
789 The preserved data are basically harmless even if the corresponding ports are out of scope of new targets unless conflicts arise.
790 .SS New installation of ports: case 1
791 If the user has not executed this utility for entire reinstallation/upgrade never or after the final clean up of the temporary database,
792 .RS
793 .B portsreinstall -i -Glq -oO
794 .I globs
795 .RE
796 will be a quick way to install new packages matching glob patters \fIglobs\fR (here the options are separated into each group just for easy understanding).
797 More automated operation is possible by appending \fB\-C\fR and \fB\-Y\fR options so as to skip all dialog queries by letting all configurations default.
798 .SS New installation of ports: case 2
799 If the user already has a complete temporary database by executing entire reinstallation/upgrade,
800 .RS
801 .B portsreinstall need add
802 .I globs
803 .RE
804 followed by
805 .RS
806 .B portsreinstall -MGlq -N redo
807 .RE
808 will be a quick and smart way to install new packages matching glob patters \fIglobs\fR.
809 More automated operation is possible by appending \fB\-C\fR and \fB\-Y\fR options so as to skip all dialog queries by letting all configurations default.
810 .SS Deinstallation and restoration of leaf and obsolete ports
811 If any new leaf ports and obsolete (lost) ports are detected, dialogs are displayed for selecting which ports/packages to delete.
812 Here it is noted that detection and operations on new leaf ports are invalidated when the temporary database is incomplete due to \fB\-o\fR option.
813 Deinstallation and restoration of the packages are carried out after reinstallation of the all ports are attempted.
814 The selected packages are backed up before deinstallation.
815 .PP
816 The selection can be modified by executing
817 .RS
818 .B portsreinstall reselect leaves
819 .RE
820 for new leaf ports, and
821 .RS
822 .B portsreinstall reselect obsolete
823 .RE
824 for obsolete ports.
825 .PP
826 Then following execution of
827 .RS
828 .B portsreinstall
829 .RE
830 deinstalls newly selected packages and restores unselected ones.
831 .SS Package build in a chroot system
832 For smooth and safe on-the-fly port upgrading, the pakage build can be carried out in a \fBchroot\fR(8) system using \fBportsreinstall-chroot\fR(8). Refer to its manual page for the detail.
833 .SS Port upgrading of a cluster system
834 In a cluster system where multiple nodes have the same software configuration, packages built in one node can be used for upgrading ports in the others.
835 The conventional flow will be as follows:
836 .PP
837 1. Share file systems for /usr/ports/packages and /home among the nodes by NFS. Here we assume that the mount points are the same among the all nodes and user "admin" is used for the system administration.
838 .PP
839 2. In the builder node, update the ports tree and the package repository catalog.
840 .RS
841 root@[builder.cluster.intranet]
842 .B portsnap fetch update
843 .RE
844 .RS
845 root@[builder.cluster.intranet]
846 .B pkg update
847 .RE
848 3. Upgrade the all pakages completely by \fBportsreinstall\fR (the command line options are just an example).
849 .RS
850 root@[builder.cluster.intranet]
851 .B portsreinstall -qC
852 .RE
853 4. Create the packages and dispatching script set. This process can be skipped when \fBportsreinstall-chroot\fR(8) was used in the previous stage.
854 .RS
855 root@[builder.cluster.intranet]
856 .B portsreinstall packupgrade create
857 .RE
858 5. Crop and extract the archive of the created dispatching script set.
859 .RS
860 root@[builder.cluster.intranet]
861 .B portsreinstall packupgrade crop /home/admin/portsreinstall-upgrade.tar.gz
862 .RE
863 .RS
864 root@[builder.cluster.intranet]
865 .B rm -rf /home/admin/portsreinstall-upgrade
866 .RE
867 .RS
868 root@[builder.cluster.intranet]
869 .B mkdir -p /home/admin/portsreinstall-upgrade
870 .RE
871 .RS
872 root@[builder.cluster.intranet]
873 .B tar xzf /home/admin/portsreinstall-upgrade.tar.gz -C /home/admin/portsreinstall-upgrade
874 .RE
875 6. Execute the dispatched script at each target node.
876 .RS
877 .B ssh -l admin target01.cluster.intranet sudo /home/admin/portsreinstall-upgrade/portsreinstall-upgrade.sh
878 .RE
879 .SS Workaround for failed ports: conflicts: case 1
880 This utility automatically resolves conflicts between ports/packages by temporary deinstallation during concerned build or installation processes according to CONFLICTS, CONFLICTS_BUILD and CONFLICTS_INSTALL defined by each port.
881 This means that ports lacking proper CONFLICTS, CONFLICTS_BUILD and CONFLICTS_INSTALL definitions may undergo failures.
882 .PP
883 Some problems may be due to coexistence of the same or related software of different versions of the requirements or the unsuccessful ports themselves.
884 For analysis of the upgraded and initial requirements,
885 .RS
886 \fBportsreinstall show requirements @all,direct \fR \fIglob\fR
887 .RE
888 and
889 .RS
890 \fBportsreinstall show initrequirements @all,direct\fR \fIglob\fR
891 .RE
892 can be used, respectively, where \fIglob\fR denotes a glob specifying the unsuccessful ports.
893 For analysis of ports for the same software of different versions,
894 .RS
895 \fBportsreinstall glob\fR \fIglob_req\fR
896 .RE
897 can be used, where \fIglob_req\fR denotes a glob specifying the suspicious requirements.
898 .PP
899 If a conflict is found, first escape (back up and delete) the conflict by
900 .RS
901 \fBportsreinstall escape\fR \fIpackage_conflict\fR
902 .RE
903 where \fIpackage_conflict\fR is the conflicting package.
904 .RS
905 .PP
906 Then execute
907 .RS
908 .B portsreinstall redo
909 .RE
910 for completing (re)installation of the dependents of the resolved port.
911 .PP
912 If the (re)installation is successful, execute
913 .RS
914 \fBportsreinstall restore\fR \fIpackage_conflict\fR
915 .RE
916 to restore the escaped package (reinstallation may fail if a newer version is installed but there is no problem).
917 If any conflicts still remain unresolved, refer to case 2.
918 .SS Workaround for failed ports: conflicts: case 2
919 If some upgraded ports fundamentally conflict with each other, the output log of this utility for do/redo processes will report a message entitled "The following ports are temporarily deleted due to conflicts".
920 In this case, although not always encouraged, the user may consider replacement of the conflicting ones with one of them by assuming and expecting compatibility between them.
921 .PP
922 This workaround can be done by the following procedure.
923 First edit the configuration file ${LOCALBASE}/etc/portsreinstall.conf so as to define the corresponding REPLACE_* values.
924 If \fBportupgrade\fR(1) is installed, the corresponding configuration should be made in ALT_PKGDEP section of \fBpkgtools.conf\fR(5).
925 .PP
926 Then execute
927 .RS
928 .B portsreinstall -L redo
929 .RE
930 .RS
931 (Recover options reset by \fB\-L\fR if any by checking with the aid of \fBportsreinstall options\fR.)
932 .RE
933 for (re)installation of the concerned port by reflecting the configuration changes.
934 .SS Workaround for failed ports: conflicts: case 3
935 If some conflicts are found to be unnecessary, they can be removed in the following way.
936 The unnecessary ports are registered by executing
937 .RS
938 .B portsreinstall noneed add
939 .I globs_unnecessary
940 .RE
941 where \fIglobs_unnecessary\fR denotes globs specifying the unnecessary ports.
942 .PP
943 Next execute
944 .RS
945 .B portsreinstall show dependents @run,full
946 .I globs_unnecessary
947 .RE
948 for checking whether any dependents seem unnecessary for the user.
949 Next execute
950 .RS
951 .B portsreinstall noneed add
952 .I globs_unnecessary_dependents
953 .RE
954 to register them, where \fIglobs_unnecessary_dependents\fR denotes globs specifying the unnecessary dependents.
955 .PP
956 Then execute
957 .RS
958 .B portsreinstall
959 .RE
960 .RS
961 (If it seems effective, reconfigure options for \fB\-B\fR, \fB\-b\fR and \fB\-o\fR by using \fB\-M\fR and \fB\-N\fR.)
962 .RE
963 for automatic evaluation and deinstallation of new leaf ports redefined by the new unnecessary ports.
964 If the registered ports are required by any non-leaf or non-unnecessary ports, this process will end up with no practical progress.
965 .SS Workaround for failed ports: reconfiguration of port options
966 If the problems may be resolved by reconfiguration of the port options, execute
967 .B portsreinstall reconf 
968 .I glob
969 which invokes the dialog for reselecting options.
970 Here \fIglob\fR denotes a glob specifying the concerned port.
971 .PP
972 If any change was made here, execute
973 .RS
974 .B portsreinstall
975 .RE
976 for retrial of (re)installation.
977 .SS Workaround for failed ports: reconfiguration of knobs
978 If the problems may be resolved by reconfiguration of the knobs, first edit the configuration file ${LOCALBASE}/etc/portsreinstall.conf so as to redefine the corresponding CONFLICT_*, MARG_*, MENV_*, BEFOREBUILD_*, BEFOREDEINSTALL_* or AFTERINSTALL_* values.
979 If \fBportupgrade\fR(1) is installed, the corresponding configuration should be made in MAKE_ARGS, MAKE_ENV, BEFOREBUILD, BEFOREDEINSTALL or AFTERINSTALL section of \fBpkgtools.conf\fR(5).
980 .PP
981 Then execute
982 .RS
983 .B portsreinstall -L redo
984 .RE
985 .RS
986 (Recover options reset by \fB\-L\fR if any by checking with the aid of \fBportsreinstall options\fR.)
987 .RE
988 for (re)installation of the concerned port by reflecting the configuration changes.
989 .SS Workaround for failed ports: update of ports tree
990 If the ports are fundamentally broken, updating the ports tree may fix the problems.
991 In this case, execute
992 .RS
993 .B portsnap fetch update
994 .RE
995 and, followed by
996 .RS
997 .B pkg update
998 .RE
999 and then
1000 .RS
1001 .B portsreinstall reset keepstatus
1002 .RE
1003 to clean everything but the option settings, information of the initially installed packages and the progress of unchanged successful ports.
1004 Then execute
1005 .RS
1006 .B portsreinstall
1007 .RE
1008 and see whether the problems are resolved.
1009 .SH "ENVIRONMENT VARIABLES"
1010 The following environment variables can be used to change the behavior of \fBportsreinstall\fR.
1011 Some of them are the same as defined in \fBports\fR(7).
1012 Usually they should be kept to be the system default or empty.
1013 The configuration file (${LOCALBASE}/etc/portsreinstall.conf) takes priority over environment variables.
1014 .TP
1015 .B LOCALBASE
1016 Where to install files of native applications.
1017 The default is /usr/local.
1018 .TP
1019 .B LINUXBASE
1020 Where to install files of Linux applications.
1021 The default is /compat/linux.
1022 .TP
1023 .B PREFIX
1024 Where to install things in general.
1025 The default value is defined for each port; it is usually ${LOCALBASE} for most native applications and ${LINUXBASE} for Linux applications.
1026 However, some ports customize it to their own defaults, e.g., ${LOCALBASE}/kde4 for KDE4-related ones.
1027 Therefore, it is safer to keep this variable undefined by the user so as to define it automatically although traditionally this variable has been used for controlling installation paths by users.
1028 .TP
1029 .B PORT_DBDIR
1030 Where to store port option values.
1031 The default is /var/db/ports.
1032 .TP
1033 .B PORTSDIR
1034 Location of the ports tree.
1035 The default is /usr/ports.
1036 .TP
1037 .B DISTDIR
1038 Where to store distfiles.
1039 The default is ${PORTSDIR}/distfiles.
1040 .TP
1041 .B PACKAGES
1042 Where to store package archives.
1043 The default is ${PORTSDIR}/packages.
1044 .TP
1045 .B PKGREPOSITORYSUBDIR
1046 Subdirectory under ${PACKAGES} to store substances of package archives.
1047 The default is "All".
1048 .TP
1049 .B PKGREPOSITORY
1050 Where to store substances of package archives.
1051 The default is ${PACKAGES}/${PKGREPOSITORYSUBDIR}.
1052 .TP
1053 .B PKG_PATH
1054 Overriding Synonym to PKGREPOSITORY for compatibility with \fBpkgtools.conf\fR(5).
1055 .TP
1056 .B PACKAGECHECKSUMROOTS
1057 Roots of available sites for legacy package check sum to be randomly selected.
1058 Each site is separated by "|" (vertical bar).
1059 The default consists of ftp://ftp.FreeBSD.org/ and from ftp://ftp1.FreeBSD.org/ to ftp://ftp14.FreeBSD.org/.
1060 .TP
1061 .B PACKAGECHECKSUMDIR
1062 Subdirectory pattern of legacy package check sum sites.
1063 The first and second \fI%s\fR are substituted with the platform and version of OS, respectively.
1064 The default is pub/FreeBSD/ports/%s/packages-%s/All/.
1065 .TP
1066 .B PACKAGEROOTS
1067 Roots of available legacy package sites to be randomly selected.
1068 Each site is separated by "|" (vertical bar).
1069 The default is ${PACKAGECHECKSUMROOTS}, but it is relatively secure to be different from it.
1070 .TP
1071 .B PACKAGEDIR
1072 Subdirectory pattern of legacy package sites.
1073 The first and second \fI%s\fR are substituted with the platform and version of OS, respectively.
1074 The default is ${PACKAGECHECKSUMDIR}.
1075 .SH FILES/DIRECTORIES
1076 The following files and directories are referred to.
1077 .TP
1078 ${LOCALBASE}/etc/portsreinstall.conf
1079 Configuration file.
1080 .TP
1081 /var/tmp/portsreinstall.db
1082 Temporal database directory.
1083 The whole contents can be saved by \fBportsreinstall save\fR command.
1084 .TP
1085 ${LOCALBASE}/etc/pkgtools.conf
1086 Configuration file of \fBportupgrade\fR(1).
1087 .SH HISTORY
1088 \fBportsreinstall\fR has been developed as below.
1089 .TP
1090 4.1.0 (?? August 2018)
1091 .RS
1092 [NEW] Option \fB\-x\fR is added.
1093 .PP
1094 [NEW] Option \fB\-s\fR is added to \fBportsreinstall\-chroot\fR(8).
1095 .PP
1096 [NEW] \fBauto\fR command is added to \fBportsreinstall\-chroot\fR(8).
1097 .PP
1098 [NEW] \fBshow errormessage\fR, \fBshow leaves\fR and \fBshow obsolete\fR commands are added.
1099 .PP
1100 [NEW] BUILDCONFLICT and INSTCONFLICT sections are added to ${LOCALBASE}/etc/portsreinstall.conf.
1101 .PP
1102 [IMPROVED] The (Re)installation scheme is changed to skip ports whose requirements are not installed at their turns, and always retry failed build.
1103 .PP
1104 [IMPROVED] It is changed to detect unflavored ports or ports with old flavor names of flavored ports as obsolete.
1105 .PP
1106 [IMPROVED] The behavior with union file systems is stabilized.
1107 .PP
1108 [IMPROVED] It is changed to show messages of reset ports at the stage of reloading ${LOCALBASE}/etc/portsreinstall.conf.
1109 .PP
1110 [IMPROVED] It is changed so that ports to freeze are upgraded to the latest available package version.
1111 .PP
1112 [IMPROVED] It is changed to unlock in all error termination.
1113 .PP
1114 [IMPROVED] Inside- and outside-parent jail/chroot mounting/unmounting operations by \fBportsreinstall\-chroot\fR(8) and \fBportsreinstall\-chroot\-mount\fR(8) are now safely protected from each other.
1115 .PP
1116 [IMPROVED] The message at the exit from \fBportsreinstall\-chroot\fR(8) builder chroot environment is modified to be less shocking.
1117 .PP
1118 [BUG FIX] \fBreset\fR command discarded the information of the initially installed packages.
1119 .PP
1120 [BUG FIX] Dependency inspection might have terminated with error when obsolete ports exist.
1121 .PP
1122 [BUG FIX] Changes made by commands or in ${LOCALBASE}/etc/portsreinstall.conf were not reflected to dependents of the specified ports in the redo runs with incorrect messages notifying as already inspected merged ports.
1123 .PP
1124 [BUG FIX] Unmounting of file systems by \fBportsreinstall\-chroot\fR(8) had some problems due to inclusion of redundant series of slashes in the path.
1125 .PP
1126 [BUG FIX] Evaluation of old origins was incomplete for merged ports and resulted in redundant detection of conflict.
1127 .PP
1128 [BUG FIX] Failure in unmounting of file systems by \fBportsreinstall\-chroot\fR(8) left the privilege lock.
1129 .PP
1130 [BUG FIX] Conflict was not correctly escaped in package installation.
1131 .PP
1132 [BUG FIX] Evaluation of globs was incorrect for the regular expression form.
1133 .PP
1134 [BUG FIX] Flavored requirements were incorrectly inspected. This also caused disability of the use of prebuilt official packages for flavord ports with the default configuration. 
1135 .RE
1136 .TP
1137 4.0.0 (29 June 2018)
1138 .RS
1139 [NEW] Flavor is supported. Related to this feature, representations of port origins without flavor is recognized to exactly match the unflavored ones.
1140 .PP
1141 [NEW] Option \fB\-F\fR is added.
1142 .PP
1143 [NEW] \fBpackupgrade\fR command is added.
1144 .PP
1145 [NEW] \fBreset keepstatus\fR command is added.
1146 .PP
1147 [NEW] \fBfreeze\fR and \fBshow freeze\fR commands are added. FREEZE section is added to ${LOCALBASE}/etc/portsreinstall.conf.
1148 .PP
1149 [NEW] \fBshow conflict_files\fR\fR command is added.
1150 .PP
1151 [NEW] CONFLICT section is added to ${LOCALBASE}/etc/portsreinstall.conf.
1152 .PP
1153 [NEW] Utilities of \fBportsreinstall-upgrade\fR(8) and \fBportsreinstall-chroot\fR(8) are added.
1154 .PP
1155 [NEW] Change of port options made outside of \fBportsreinstall\fR(8) is automatically detected.
1156 .PP
1157 [IMPROVED] The (re)installation process is changed to be repeated until all-automatically resolvable problems are resolved. Thus there is no more need to simply repeat \fBredo\fR command to complete the automatic solution.
1158 .PP
1159 [IMPROVED] The way of detecting the packages system is changed to check both WITH_PKG and WITH_PKGNG in accordance with the specification change of the ports tree. The descriptions about the packages system is updated as well.
1160 .PP
1161 [IMPROVED] \fBreset\fR command is improved to reset the database cleaner and preserve manually set taboo/freeze/need/noneed lists.
1162 .PP
1163 [IMPROVED] \fBreconf\fR command is changed to be available any time.
1164 .PP
1165 [IMPROVED] Inspection of merged ports is improved to make the deinstallation of old packages effective.
1166 .PP
1167 [BUG FIX] \fBpkgsanity\fR command had lost its ability to detect missing files because of the specification change of \fBpkg\fR(8).
1168 .PP
1169 [BUG FIX] Command line arguments could have interpreted "add" keyword as a glob matching math/add.
1170 .PP
1171 [BUG FIX] Option \fB\-k\fR did not work properly with option \fB\-g\fR.
1172 .RE
1173 .TP
1174 3.3.2 (15 February 2017)
1175 .RS
1176 .PP
1177 [CHANGED] The permission of the configuration sample file is changed to writable so that \fBpkg\fR(8) will install the configuration file to be writable.
1178 .PP
1179 [BUG FIX] "Selection of removing leaf ports" might have failed at ports which has not been installed yet and becomes leaves by REPLACE_* tags in the configuration file.
1180 .RE
1181 .TP
1182 3.3.1 (18 August 2016)
1183 .RS
1184 [BUG FIX] Detection of the default option configuration was unsuccessful or wrong when /etc/make.conf was configured; some ports caused aborting in the phase of inspection.
1185 .PP
1186 [BUG FIX] Error messages from failed detection of option configuration were not output.
1187 .RE
1188 .TP
1189 3.3.0 (10 July 2016)
1190 .RS
1191 [NEW] Option \-f is added.
1192 .PP
1193 [IMPROVED] Automatic workaround of looped dependencies is implemented at the phase of "Completion of *-time requirement lists" in the preparation stage.
1194 .PP
1195 [CHANGED] Dependencies on \fBpkg\fR(8) is changed to be ignored.
1196 .PP
1197 [BUG FIX] The rescue process for cases missing \fBpkg\fR(8) was not working well.
1198 .PP
1199 [BUG FIX] The phase of "Completion of *-time requirement lists" in the preparation stage was caught into an infinite loop when looped dependencies exist.
1200 .PP
1201 [BUG FIX] Comments on termination were unavailable in some phases.
1202 .PP
1203 [BUG FIX] The messages of currently installed packages may have shown duplicated ones.
1204 .RE
1205 .TP
1206 3.2.1 (27 January 2015)
1207 .RS
1208 [BUG FIX] The automatic resolution of installation conflict implemented in the previous version was seriously broken and judged conflicts incorrectly.
1209 .RE
1210 .TP
1211 3.2.0 (30 December 2014)
1212 .RS
1213 [IMPROVED] The automatic resolution of installation conflict is improved to avoid stripping due to restore\-and\-delete of backup packages that possibly occurs when the default version changes.
1214 .PP
1215 [IMPROVED] Support for cases that alternative version of ports\-mgmt/pkg (ports\-mgmt/pkg\-devel, switched by defining WITH_PKG=devel in /etc/make.conf) or ports-mgmt/dialog4ports (DIALOGPORT=\fIport_origin\fR in /etc/make.conf, reserved for the future) is used are implemented.
1216 .PP
1217 [BUG FIX] Reinstallation of \fBpkg\fR(8) could encounter error termination.
1218 .RE
1219 .TP
1220 3.1.1 (17 December 2014)
1221 .RS
1222 [IMPROVED] The automatic resolution of installation conflict is improved to detect actual conflict not described in CONFLICTS or CONFLICTS_INSTALL (for the sake of the staging mechanism).
1223 .PP
1224 [BUG FIX] MOVED or REPLACED ports were sometimes incorrectly detected as duplicated ports.
1225 .PP
1226 [BUG FIX] Command \fBpkgsanity\fR was confused by the specification change of \fBpkg\-check\fR(8).
1227 .PP
1228 [BUG FIX] Option \fB\-q\fR did not work correctly in version 3.1.0.
1229 .RE
1230 .TP
1231 3.1.0 (9 August 2014)
1232 .RS
1233 [IMPROVED] Command \fBreset\fR is now available to work with an updated ports tree by preserving information of the initially installed packages.
1234 The manual page is updated by adding "Workaround for failed ports: update of ports tree" subsection to explain an example to utilize this improved specification.
1235 .PP
1236 [IMPROVED] A countermeasure operation is implemented for a bug of pkg-1.3.4 that \fBpkg delete \-q\fR does not work.
1237 .PP
1238 [IMPROVED] Revisions are made so that packages whose ports are replaced or moved are deinstalled before installation of the alternative ports.
1239 .PP
1240 [IMPROVED] Reinstalltion of ports-mgmt/pkg becomes smarter in systems where Pkgng is the default.
1241 .PP
1242 [BUG FIX] Command \fBprepare\fR was possibly aborted at a port any of whose requirements or dependents is obsolete.
1243 .PP
1244 [BUG FIX] It silently failed to launch if the ports tree is missing or broken.
1245 .PP
1246 [BUG FIX] The short help lacked descriptions on \fBneed\fR command.
1247 .PP
1248 [BUG FIX] Some message output failed with a warning "3: Bad file descriptor" in some environment (detected in 10.0-RELEASE).
1249 .PP
1250 [BUG FIX] The error message for specifying option \fB\-L\fR or \fB\-N\fR for other than \fBredo\fR command was wrong (\fB\-L\fR was missing).
1251 .PP
1252 [BUG FIX] Control sequences in output of the long help by \fB\-H\fR option was not correctly handled in some environment (detected in 10.0\-RELEASE).
1253 .PP
1254 [BUG FIX] Reload of configuration where replacement rule is changed possibly caused errors in the phase of "Inspection of necessity".
1255 .PP
1256 [BUG FIX] Messages about failed ports were inappropriate when failed ports were changed to unneeded.
1257 .PP
1258 [BUG FIX] Evaluation of glob was incorrect when the pattern is regular expression containing multiple slashes.
1259 .PP
1260 [BUG FIX] Warning messages might have arise by attempting to restore nonexistent backed\-up requirements.
1261 .PP
1262 [BUG FIX] The error message for invalid operation on \fBreselect\fR command was wrong.
1263 .PP
1264 [BUG FIX] Selection of leaf packages remained after all of them changed to non\-leaves.
1265 .PP
1266 [BUG FIX] Ports with periods or underscores in their package name, port name or origin were not be treated correctly.
1267 .PP
1268 [BUG FIX] Changes in "REPLACE_*" in ${LOCALBASE}/etc/portsreinstall.conf were not correctly reflected in recursive reinstallation of dependents. The specification of the temporary database is changed for this fix.
1269 .PP
1270 [BUG FIX] Execution of \fBreset\fR command unintentionally removed temporally deinstalled leaf ports out of scope of reinstallation.
1271 .PP
1272 [BUG FIX] A wrong option was given to \fBpkg-info(8)\fR in a compatible command for \fBpkg_info \-qoX\fR.
1273 .PP
1274 [BUG FIX] Variables "NOPKG_*" in ${LOCALBASE}/etc/portsreinstall.conf were not parsed.
1275 .RE
1276 .TP
1277 3.0.5 (14 December 2013)
1278 .RS
1279 [NEW] Command of \fBrmconf\fR is added.
1280 .PP
1281 [IMPROVED] Automatic resolution of duplicated registrations of multiple packages for the same port origin is implemented in \fBpkgsanity\fR command.
1282 .PP
1283 [CHANGED] Specification changes are made so that (re)installation processes are skipped for ports any of whose requirements is missing. This results in improvement to avoid attempt of unsuccessful builds due to unsuccessful installation of requirements and a fix of the following bug regarding unintentional reinstallation of escaped packages.
1284 .PP
1285 [BUG FIX] Execution of \fBreconf\fR command confused the work of \fB\-G\fR option.
1286 .PP
1287 [BUG FIX] Escaped packages by \fBescape\fR command were unintentionally reinstalled in (re)installation of their dependents.
1288 .RE
1289 .TP
1290 3.0.4 (16 November 2013)
1291 .RS
1292 [IMPROVED] Support for systems in which pkgng is the default or legacy package tools are abandoned is improved.
1293 .PP
1294 [IMPROVED] Changes are made so that MAKE_JOBS_UNSAFE=yes is set in retrials of build and installation.
1295 .PP
1296 [MISC] The manual page is updated regarding \fB\-G\fR option by reflecting the official service start of pkgng packages and abandonment of the legacy packages.
1297 .PP
1298 [BUG FIX] Commands of \fBforget\fR and \fBreconf\fR and option \fB\-L\fR could have caused error ends in following \fBshow failure\fR command and the part showing the failure list at the end of execution of \fBdo\fR and \fBredo\fR commands.
1299 .PP
1300 [BUG FIX] The execution was terminated by error when /etc/make.conf does not exist.
1301 .PP
1302 [BUG FIX] The execution was terminated by error when there is no INDEX file for the current OS version is prepared.
1303 .PP
1304 [BUG FIX] Some meaningless warnings are suppressed.
1305 .PP
1306 [BUG FIX] Comments at termination during building the temporary database were inconsistent.
1307 .RE
1308 .TP
1309 3.0.3 (2 August 2013)
1310 .RS
1311 [BUG FIX] Cleaning of distfiles before retrial of failed fetch was forgotten.
1312 .RE
1313 .TP
1314 3.0.2 (10 July 2013)
1315 .RS
1316 [NOTE] Version 3.0.1 has a serious defect that newly installed files can be spoiled by restoration of conflicting old packages. When the current version is to executed only for limited ports (with \fB\-q\fR, \fB\-t\fR, \fB\-T\fR or \fB\-O\fR) after this previous version was used, in advance to that, it is strongly encouraged to execute
1317 .RS
1318 \fBportsreinstall pkgsanity\fR
1319 .RE
1320 and select "y" in the queries for spoiled packages.
1321 .PP
1322 [NEW] Commands of \fBpkgsanity\fR and \fBshow status\fR are added.
1323 .PP
1324 [IMPROVED] Changes are made so as to deinstall conflicts before the first trials in build and installation.
1325 .PP
1326 [IMPROVED] Changes are made so as to prevent restoration of backed-up packages deinstalled due to matching CONFLICTS_INSTALL of installed packages.
1327 .PP
1328 [IMPROVED] Changes are made so as to retry build by deinstalling the current package and packages matching CONFLICTS_INSTALL even if not in CONFLICTS_BUILD nor CONFLICTS.
1329 .PP
1330 [IMPROVED] Command \fBshow conflict\fR is changed to append a column of opponent ports of each conflict.
1331 .PP
1332 [CHANGED] Changes are made so that FORCE_PKG_REGISTER is disabled in the all operations. This had become obsolete and even harmful after the implementation of the automatic workaround function for conflicts.
1333 .PP
1334 [MISC] Minor changes are made on HISTORY section of the manual page in the level of coding and terminology.
1335 .PP
1336 [BUG FIX] Configuration changes in replacement were not completely reflected by redo with \fB\-L\fR option and ended up with errors.
1337 .PP
1338 [BUG FIX] Deinstallation of obsolete or new leaf ports did not work in version 3.0.1.
1339 .PP
1340 [BUG FIX] Conflicts escape was not implemented for (re)installation by prebuilt packages.
1341 .PP
1342 [BUG FIX] The message format in enumerating port origins or so on was broken.
1343 .RE
1344 .TP
1345 3.0.1 (11 June 2013)
1346 .RS
1347 [NEW] Commands \fBescape\fR and \fBrestore\fR are added.
1348 .PP
1349 [IMPROVED] The behavior of \fB\-C\fR option is changed in case of \fBdialog4ports\fR(1) so that the port options are unchanged and unsaved throughout the all stages from the temporary database build to (re)installation. This allows the all stages to run on \fBscript\fR(1) and \fBnohup\fR(1).
1350 .PP
1351 [IMPROVED] Changes are made so that installation by packages is split into fetch and installation stages and backup/deletion of old packages are skipped if the fetch is unsuccessful.
1352 .PP
1353 [IMPROVED] Changes are made so that uninspected ports are skipped in \fBreconf\fR command.
1354 .PP
1355 [IMPROVED] A measure to cases of duplicated packages for the same port is implemented.
1356 .PP
1357 [BUG FIX] Commands permitted for unprivileged users did not work for the users.
1358 .PP
1359 [BUG FIX] This manual page, comments and messages contained some wrong English words and incorrect descriptions.
1360 .PP
1361 [BUG FIX] Runs by unprivileged users could end up with errors in message output if /dev/stdin cannot provide information of the console size.
1362 .PP
1363 [BUG FIX] Meaningless warnings are suppressed.
1364 .PP
1365 [BUG FIX] Leaf ports replaced by REPLACE_* were recognized to be new leaf ports to delete even if they are targets of \fB\-O\fR, \fB\-T\fR or \fB\-t\fR or in the needed list.
1366 .PP
1367 [BUG FIX] Evaluation of glob patterns which have the form of port origin was inappropriately ambiguous.
1368 .PP
1369 [BUG FIX] Reinstallation processes were unintentionally terminated when the backup package creation was unsuccessful.
1370 .PP
1371 [BUG FIX] Options \fB\-O\fR, \fB\-T\fR and \fB\-t\fR did not work for once-succeeded ports.
1372 .PP
1373 [BUG FIX] Detection of conflict was overestimated for some ports.
1374 .RE
1375 .TP
1376 3.0.0 (01 June 2013)
1377 .RS
1378 [NEW] Options of \fB\-a\fR, \fB\-A\fR, \fB\-b\fR, \fB\-B\fR, \fB\-C\fR, \fB\-D\fR, \fB\-g\fR, \fB\-G\fR, \fB\-i\fR, \fB\-I\fR, \fB\-l\fR, \fB\-L\fR, \fB\-M\fR, \fB\-n\fR, \fB\-o\fR, \fB\-O\fR, \fB\-X\fR and \fB\-Y\fR are added (\fB\-X\fR is redefined as a different function).
1379 .PP
1380 [NEW] Long options are supported.
1381 .PP
1382 [NEW] Commands \fBneed\fR, \fBnoneed\fR, \fBreset\fR, \fBforget\fR, \fBreselect\fR, \fBglob\fR, \fBreconf\fR, \fBoptions\fR, \fBshow need\fR, \fBshow noneed\fR, \fBshow restored\fR and \fBshow conflict\fR are added.
1383 .PP
1384 [NEW] (Re)installation by prebuilt packages for ports with default configurations is implemented.
1385 .PP
1386 [NEW] Controlling the dependency scope for \fBshow\fR command becomes available. 
1387 .PP
1388 [NEW] Commands of \fBdo\fR, \fBprepare\fR and \fBredo\fR are rearranged with \fBdo\fR and \fBredo\fR with an optional mode either of \fBprepare\fR or \fBall\fR so that the default and synonyms are compatible with the earlier versions.
1389 .PP
1390 [CHANGED] The function of \fBshow redo\fR is replaced with that of former \fBshow pending\fR, and \fBshow pending\fR is abandoned in exchange.
1391 .PP
1392 [CHANGED] Deinstallation of obsolete packages becomes selectable by run\-time dialog.
1393 .PP
1394 [CHANGED] Deinstallation and ignorance of leaf ports becomes available via selection by run\-time dialog.
1395 .PP
1396 [CHANGED] The directory for saving packages of obsolete or removed leaf ports are changed to $PACKAGES/All whose default is /usr/ports/packages/All.
1397 .PP
1398 [CHANGED] The deinstallation process for unused packages which have been done before reinstallation is changed to be done after it.
1399 .PP
1400 [CHANGED] Compact forms of options is made to be accepted, e.g., \fB\-b \-t \-o\fR as \fB\-bto\fR.
1401 .PP
1402 [CHANGED] The behaviors of \fB\-q\fR, \fB\-t\fR and \fB\-T\fR options are changed to ignore build\-time-only dependencies. The former function is reproduced with \fB\-b\fR option. The document for \fB\-t\fR and \fB\-T\fR options are revised so as to correct wrong descriptions that they could newly install the specified ports.
1403 .PP
1404 [CHANGED] Syntax of \fB\-t\fR and \fB\-T\fR options are changed so as to give all port globs by a single argument value as concatenation with colons as delimiters. Along this change, \fB\-r\fR and \fB\-R\fR options are abandoned.
1405 .PP
1406 [CHANGED] Old options of \fB\-x\fR and \fB\-X\fR are abandoned due to duplication with \fBtaboo add\fR command.
1407 .PP
1408 [CHANGED] Rules for transferring option settings to restarted runs are changed so as to let the all options renewable.
1409 .PP
1410 [CHANGED] The evaluation algorithm of glob patterns is improved and changed to be fully original.
1411 .PP
1412 [CHANGED] The long help is unified with this manual page.
1413 .PP
1414 [IMPROVED] A change is made so as to carry out upgrade of ports-mgmt/pkg in advanced to everything in case of pkgng and as to ignore dependencies on ports-mgmt/pkg.
1415 .PP
1416 [IMPROVED] The treatment of backup packages is modified to be safer by considering possible format fluctuation in case of pkgng.
1417 .PP
1418 [IMPROVED] Automatic solution to conflicts in (re)installation is implemented.
1419 .PP
1420 [MISC] Line feeds of the help and information messages are improved.
1421 .PP
1422 [BUG FIX] Meaningless warnings at the end of leaf ports are suppressed.
1423 .PP
1424 [BUG FIX] Inappropriate operations could have been attempted on the temporary database by non-superuser privilege.
1425 .PP
1426 [BUG FIX] Tarballs for ports which depend on other ports could have been lost in the step of cleaning distfiles.
1427 .PP
1428 [BUG FIX] Self-upgrade was carried out even for commands other than do or prepare.
1429 .RE
1430 .TP
1431 2.2.2 (03 January 2013)
1432 .RS
1433 [BUG FIX] Commands \fBok add\fR and \fBok del\fR failed if no port has reinstalled in the latest do/redo process.
1434 .PP
1435 [BUG FIX] Makefile was problematic if ${LOCALBASE}/etc/portsreinstall.conf does not exist before installation.
1436 .RE
1437 .TP
1438 2.2.1 (25 December 2012)
1439 .RS
1440 [CHANGED] Command \fBshow todo_next\fR is renamed to \fBshow pending\fR.
1441 .PP
1442 [IMPROVED] Changes are made so as to avoid retrying for dependents of failed ports when no problem has resolved.
1443 .PP
1444 [BUG FIX] Removed a remained debugging code in the action for \fBsave\fR command.
1445 .RE
1446 .TP
1447 2.2.0 (17 December 2012)
1448 .RS
1449 [NEW] Command of \fBshow todo_next\fR is added.
1450 .PP
1451 [CHANGED] Changes are made so as to skip wasteful reinstallation where the target port is already reinstalled once (with \fB\-q\fR option, when its version is up-to-date) and no change has been made for either of its requirements afterwards.
1452 .PP
1453 [CHANGED] The default settings in portsreinstall.conf was changed so as to include a HOLD pattern for bsdpan.
1454 .PP
1455 [BUG FIX] There was a problem in evaluating glob patterns expressing origins.
1456 .PP
1457 [BUG FIX] Minor inappropriate messages and actions emerged when the target and replacement of ports substitution become the same.
1458 .PP
1459 [BUG FIX] The help messages and this manual page lacked the descriptions about \fBshow redo\fR command.
1460 .RE
1461 .TP
1462 2.1.0 (10 December 2012)
1463 .RS
1464 [NEW] New generation package (pkgng) is supported.
1465 .PP
1466 [IMPROVED] A countermeasure for a build failure in a restarted build from a terminated build is implemented.
1467 .PP
1468 [BUG FIX] Restoration of backup packages after failed installation was not working correctly.
1469 .PP
1470 [BUG FIX] The transferring mechanism of option values to restarted run was broken.
1471 .PP
1472 [BUG FIX] Error end in case that no packages are installed is fixed.
1473 .PP
1474 [BUG FIX] A glob evaluation routine used when \fBports_glob\fR(1) is not installed was broken.
1475 .RE
1476 .TP
1477 2.0.0 (12 August 2012)
1478 .RS
1479 [NEW] Options \fB\-X\fR, \fB\-r\fR and \fB\-R\fR are added so as to compensate a fact that \fB\-x\fR, \fB\-t\fR and \fB\-T\fR cannot specify package names with commas.
1480 .PP
1481 [NEW] Commands of \fBshow requirements\fR and  \fBshow dependents\fR are added.
1482 .PP
1483 [NEW] A functionality of self-upgrade is added so as to be carried out first if the port of portsreinstall is new.
1484 .PP
1485 [NEW] Option \fB\-k\fR is added for cases that upgrade of portsreinstall should be avoided.
1486 .PP
1487 [IMPROVED] Messages are extended to output configuration parameter values.
1488 .PP
1489 [CHANGED] Functionalities of options \fB\-t\fR and \fB\-T\fR are changed so as to prevent deinstallation of irrelevant packages and detect obsolete installed dependencies.
1490 .PP
1491 [CHANGED] Use of commas as delimiters in \fBok\fR and \fBtaboo\fR commands is abolished.
1492 .PP
1493 [CHANGED] The specification of \fBshow\fR command is changed to exclude irrelevant packages/ports and output messages about the matching targets when options \fB\-r\fR, \fB\-R\fR, \fB\-t\fR and \fB\-T\fR are enabled.
1494 .PP
1495 [CHANGED] The default behavior in case that the temporary database is older than the ports tree is changed from warnings to automatic reconstruction; the old behavior is recovered by option \fB\-c\fR.
1496 .PP
1497 [BUG FIX] Termination message is corrected (portsreinstall ok => portsreinstall ok add).
1498 .PP
1499 [BUG FIX] Values of BEFOREBUILD, BEFOREDEINSTALL and AFTERINSTALL were not correctly imported from \fBpkgtools.conf\fR(5).
1500 .PP
1501 [BUG FIX] The file name given by save command was with a wrong time stamp.
1502 .RE
1503 .TP
1504 1.1.0 (28 April 2012)
1505 .RS
1506 [NEW] Command of show deleted is newly added.
1507 .PP
1508 [CHANGED] Origin names in messages and results of show command are changed to be accompanied with package names.
1509 .PP
1510 [CHANGED] The default option for treating \fBpkgtools.conf\fR(5) is changed to \fB\-p\fR and \fB\-Q\fR is newly added.
1511 .PP
1512 [IMPROVED] Custom make environment variables and arguments are changed to be reflected in the stage of inspection of dependencies.
1513 .PP
1514 [IMPROVED] Command of show todo is now available before starting reinstallation.
1515 .PP
1516 [BUG FIX] Independence from \fBportupgrade\fR(1) was incomplete.
1517 .PP
1518 [BUG FIX] Error messages for show command when the temporary database does not exist are improved.
1519 .PP
1520 [BUG FIX] Ports with names contaning '+' were not correctly treated.
1521 .PP
1522 [BUG FIX] Save and load commands were broken.
1523 .PP
1524 [BUG FIX] Deletion of MOVED-back packages is now prevented.
1525 .RE
1526 .TP
1527 1.0.0 (14 March 2012)
1528 .RS
1529 [MISC] Explanations for \fB\-p\fR and \fB\-P\fR are revised because the previous ones were somewhat confusing.
1530 .PP
1531 [MISC] The output device of helps is changed from stderr to stdout.
1532 .PP
1533 [MISC] Messages for termination during deinstallation and reinstallation are improved by showing the target port/package names at that time.
1534 .PP
1535 [BUG FIX] Glob patterns for package/port names were not fully supported.
1536 .PP
1537 [BUG FIX] Values of MARG_* and MENV_* (MAKE_ARGS and MAKE_ENV in \fBpkgtools.conf\fR(5)) were not working.
1538 .PP
1539 [BUG FIX] Globs of obsolete packages were not detected, so especially HOLD_PKGS and IGNORE_MOVED in \fBpkgtools.conf\fR(5) and portsreinstall.conf had lost their functionalities.
1540 .PP
1541 [BUG FIX] Values of IGNORE_MOVED partially overwrote HOLD_PKGS in \fBpkgtools.conf\fR(5).
1542 .PP
1543 [BUG FIX] Typographic and grammatical errors in the main script and documents are revised.
1544 .RE
1545 .TP
1546 0.13.1 (29 October 2011)
1547 .RS
1548 [BUG FIX] Inspection of missing ports was incomplete.
1549 .PP
1550 [BUG FIX] Origin names with '+' were not correctly treated.
1551 .PP
1552 [IMPROVED] Inspection of dependencies of installed packages gets faster.
1553 .RE
1554 .TP
1555 0.13.0 (28 August 2011)
1556 .RS
1557 [IMPROVED] Phase of "Order the ports considering dependencies" is accelerated.
1558 .RE
1559 .TP
1560 0.12.0 (22 June 2011)
1561 .RS
1562 [NEW] \fB\-q\fR, \fB\-d\fR and \fB\-N\fR options are added.
1563 .PP
1564 [CHANGED] Settings for \fB\-x\fR and \fB\-s\fR options becomes to be transferred to restarted runs.
1565 .RE
1566 .TP
1567 0.11.0 (17 May 2011)
1568 .RS
1569 [NEW] Causes of errors are added to the report of failed ports.
1570 .PP
1571 [CHANGED] Functionality of \fB\-t\fR option is changed and partly splitted into \fB\-T\fR.
1572 .PP
1573 [IMPROVED] Refetch after fetch failure becomes smarter so as not to clean up distfiles.
1574 .PP
1575 [MISC] Terminology 'abort' is corrected to be 'terminate'.
1576 .RE
1577 .TP
1578 0.10.0 (11 Mar 2011)
1579 .RS
1580 [NEW] Version check for temporary database and portupgrade is added (as a template).
1581 .PP
1582 [BUG FIX] Old packages for ports whose package names was renamed were not deleted.
1583 .PP
1584 [BUG FIX] Duplicated cleans were executed after successful installation.
1585 .RE
1586 .TP
1587 0.9.8 (02 Mar 2011)
1588 .RS
1589 [MISC] Installation methods of non-executable files in Makefile are improved again.
1590 .RE
1591 .TP
1592 0.9.7 (02 Mar 2011)
1593 .RS
1594 [MISC] Installation methods of non-executable files in Makefile are improved.
1595 .RE
1596 .TP
1597 0.9.6 (01 Mar 2011)
1598 .RS
1599 [BUG FIX] Fix at version 0.9.5 was incomplete.
1600 .PP
1601 [BUG FIX] The release date of 0.9.5 was wrong in the manpage.
1602 .RE
1603 .TP
1604 0.9.5 (28 Feb 2011)
1605 .RS
1606 [BUG FIX] "install" target in Makefile installed non-executable files as executables.
1607 .RE
1608 .TP
1609 0.9.4 (17 Jan 2011)
1610 .RS
1611 [BUG FIX] "all" target in Makefile was missing.
1612 .RE
1613 .TP
1614 0.9.3 (16 Jan 2011)
1615 .RS
1616 [MISC] Makefile is modified to compress manpage in the build process.
1617 .RE
1618 .TP
1619 0.9.2 (10 Jan 2011)
1620 .RS
1621 [MISC] The 2-Clause BSD License is applied from this version.
1622 .PP
1623 [NEW] Manpage is created.
1624 .PP
1625 [NEW] Makefile for installation/uninstallation is added.
1626 .PP
1627 [BUG FIX] Recovery from distfile checksum error was broken.
1628 .RE
1629 .TP
1630 0.9.1 (27 Dec 2010)     
1631 .RS
1632 [BUG FIX] Wrong warning for \fB\-p\fR/\fB\-P\fR options in the first run.
1633 .PP
1634 [BUG FIX] Broken support of recursive chase of MOVED ports.
1635 .PP
1636 [BUG FIX] Option configuration menus were not accessable.
1637 .PP
1638 [BUG FIX] The mechanism of loading the configuration file was broken.
1639 .PP
1640 [BUG FIX] Optionally added taboo ports were not always effective in restart.
1641 .RE
1642 .TP
1643 0.9.0 (21 Nov 2010)
1644 .RS
1645 First version.
1646 .SH APPENDIX: Conditions determining the package system (general specification of FreeBSD Ports/Packages)
1647 The current package system is automatically detected according to the OS version whose serial number is obtained by
1648 .RS
1649 .B sysctl -n kern.osreldate
1650 .RE
1651 and the configuration of /etc/make.conf.
1652 Pkgng is supported for systems with serial numbers of 800505 (just before 8.1-RELEASE) or later.
1653 For systems of 1000017 (10-CURRENT) or later, Pkgng is the default.
1654 .PP
1655 In order to choose pkgng in systems from 800505 (just before 8.1-RELEASE) to just before 1000017 (10-CURRENT), put
1656 .RS
1657 .B WITH_PKGNG=yes
1658 .RE
1659 .RS
1660 or
1661 .RE
1662 .RS
1663 .B WITH_PKG=yes
1664 .RE
1665 in /etc/make.conf.
1666 .PP
1667 In order to choose the legacy one in systems of 1000017 (10-CURRENT) or later, put
1668 .RS
1669 .B WITHOUT_PKGNG=yes
1670 .RE
1671 .RS
1672 or
1673 .RE
1674 .RS
1675 .B WITHOUT_PKG=yes
1676 .RE
1677 in /etc/make.conf.
1678 .SH "SEE ALSO"
1679 \fBpkg_glob\fR(1),
1680 \fBportupgrade\fR(1),
1681 \fBportsdb\fR(1),
1682 \fBports_glob\fR(1),
1683 \fBpkgtools.conf\fR(5),
1684 \fBports\fR(7),
1685 \fBpkg\-add\fR(8),
1686 \fBpkg\-create\fR(8),
1687 \fBpkg\-delete\fR(8),
1688 \fBportmaster\fR(8)
1689 \fBportsreinstall\-chroot\fR(8),
1690 \fBportsreinstall\-chroot\-mount\fR(8),
1691 \fBportsreinstall\-upgrade\fR(8),
1692 .SH COPYRIGHT
1693 This software is distributed under the 2-Clause BSD License.
1694 .PP
1695 (C)\ 2010\-2018\ Mamoru\ Sakaue,\ MwGhennndo,\ All\ Rights\ Reserved.
1696 .PP
1697 Email:\ sakaue.mamoru@samurai.mwghennn.net
1698 .PP
1699 Homepage:\ http://www.mwghennndo.com/software/portsreinstall/