OSDN Git Service

[IMPROVED] It is changed so that ports to freeze are upgraded to the latest available...
[portsreinstall/current.git] / man / portsreinstall.8
index 16895ec..d85cc05 100644 (file)
@@ -1,8 +1,8 @@
 .\" ==================================================================================
-.\" ports reinstall installation guide
-.\" Copyright (C) 2010-2013 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+.\" portsreinstall(8) manual page
+.\" Copyright (C) 2010-2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
 .\" ==================================================================================
-.TH PORTSREINSTALL 8 "01 June 2013" "FreeBSD" "FreeBSD System Manager's Manual"
+.TH PORTSREINSTALL 8 "29 June 2018" "FreeBSD" "FreeBSD System Manager's Manual"
 .SH NAME
 portsreinstall \- ports upgrading utility for massive forced reinstallation
 .SH SYNOPSIS
@@ -19,14 +19,35 @@ command
 ]
 .SH DESCRIPTION
 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.
-.SH NOTATIONS
- A \fIglob\fR is an extended regular expression or a shell\-type glob pattern matching either of a unique name, package names or port origins.
- 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).
- If a glob starts with a colon ":", the following string is parsed as an extended regular expression, and otherwise a shell\-type glob.
- 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.
- Here, the evaluation of the bracket is actually done by passing it to an extended regular expression by simply converting the prefix "[!" to "[^".
- 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.
- 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".
+.SH ROBUSTNESS AGAINST TERMINATION AND RESTART
+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.
+.SH FLAVOR SUPPORT
+As of the release time of this software, the flavor support of the Ports Collection has many incomplete features.
+Therefore, users should note that problems may arrise due to the specification changes related to flavors.
+Currenly, coexistence with \fBportupgrade\fR(1) is suspended due to the lack of flavor support.
+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.
+.SH GLOB PATTERNS
+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.
+The format of a \fIglob\fR may be either:
+.RS
+.IP \fIunique_name_glob\fR
+.IP \fIpackage_name_glob\fR
+.IP \fIport_origin_glob\fR
+.IP \fIport_origin_glob@flaver_glob\fR
+.IP \fI:unique_name_regexp\fR
+.IP \fI:package_name_regexp\fR
+.IP \fI:port_origin_regexp\fR
+.IP \fI:port_origin_regexp@flaver_regexp\fR
+.RE
+where each regular expression (*_regexp) and glob (_glob) pattern must not include any at sign (@).
+Port origin patterns without at sign match all available flavors if deined.
+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).
+If a glob starts with a colon ":", the following string is parsed as an extended regular expression, and otherwise a shell\-type glob.
+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.
+Here, the evaluation of the bracket is actually done by passing it to an extended regular expression by simply converting the prefix "[!" to "[^".
+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.
+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".
+When the \fIglob\fR should match the all flavors of a port, a regular expression can be used such as ":devel/py-setuptools(|@.*)".
 .SH ARGUMENTS
 One of the following \fIcommands\fR can be given for optional operations or confirmation.
 .TP
@@ -34,7 +55,7 @@ One of the following \fIcommands\fR can be given for optional operations or conf
 .PD 0
 .TP
 \fBdo all\fR
-Full execution (default).
+(Default) Full execution.
 .TP
 \fBprepare\fR
 .PD 0
@@ -59,18 +80,23 @@ In case of restarting a stopped \fBredo prepare\fR process, execute by \fBprepar
 Clean up the temporary database.
 .TP
 \fBclean force\fR
-Clean up the temporary database without checking the privilege.
+Attempt to clean up the temporary database without checking the lock and privilege.
 .TP
 \fBreset\fR
 .PD 0
 .TP
 \fBreset all\fR
 Reset the temporary database by preserving the initial snapshot of installed packages.
-This is for a rescue in case the temporary database is broken.
+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.
 .TP
 \fBreset keepopts\fR
-Reset the temporary database by preserving the initial snapshot of installed packages and option settings.
-This is for a rescue in case the temporary database is broken.
+Reset the temporary database by preserving the initial snapshot of installed packages, option settings and manually added \fBtaboo\fR/\fBneed\fR/\fBnoneed\fR ports.
+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.
+.TP
+\fBreset keepstatus\fR
+Reset the temporary database by preserving the progress status to reuse for unchanged successfully (re)installed ports.
+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.
+This command can be used to more smartly restart reinstallation when the ports tree is updated after the previous run.
 .TP
 \fBok add\fR \fIglob1\fR [\fIglob2\fR ...]
 Register manually resolved ports.
@@ -85,14 +111,24 @@ Register taboo ports that must not be built or newly (re)installed.
 The port globs are separated from each other by comma or space.
 Registration to be "taboo" practically invalidates "necessary" registered by \fBnoneed add\fR command.
 Ports specified in the HOLD section in the configuration file are protected from deinstallation.
-The port globs are separated from each other by comma or space.
-This functionality is intended to avoid manually deinstalled ports because of confliction or ports whose build or installation operations can damage the system, e.g., by flooding the file systems or kernel panic.
+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.
 This command is for temporal definitions and permanent definitions should be given as TABOO_* values in ${LOCALBASE}/etc/portsreinstall.conf instead.
 .TP
 \fBtaboo del\fR \fIglob1\fR [\fIglob2\fR ...]
 Deregister taboo ports.
 The port globs are separated from each other by comma or space.
 .TP
+\fBfreeze add\fR \fIglob1\fR [\fIglob2\fR ...]
+Register ports to freeze that must not be built but the package installtion by any available version may be safe.
+If the specified ports failed to (re)install by packages, build of their dependents are also suppressed.
+The port globs are separated from each other by comma or space.
+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.
+This command is for temporal definitions and permanent definitions should be given as FREEZE_* values in ${LOCALBASE}/etc/portsreinstall.conf instead.
+.TP
+\fBfreeze del\fR \fIglob1\fR [\fIglob2\fR ...]
+Deregister ports to freeze.
+The port globs are separated from each other by comma or space.
+.TP
 \fBneed add\fR \fIglob1\fR [\fIglob2\fR ...]
 Register necessary ports that should be newly installed if not yet and kept installed even if being obsolete.
 The port globs are separated from each other by comma or space.
@@ -136,23 +172,37 @@ Load a temporary database archive.
 Note that the currently temporary database is removed.
 .TP
 \fBglob\fR \fIglob\fR [\fIglob2\fR ...]
-Evaluate port globs and show matched origins both for installed and uninstalled packages.
+Evaluate port globs and show matched flavored origins both for installed and uninstalled packages.
 .TP
 \fBoptions\fR
 Show saved option settings and expected effects of option-resetting options \fB\-L\fR, \fB\-M\fR and \fB\-N\fR.
 With \fB\-a\fR option, the first, second and third columns denote the option-resetting options, reset options and remaining options, respectively.
 .TP
+\fBrmconf\fR \fIglob\fR [\fIglob2\fR ...]
+Reset port options for the specified ports to the default and reset affected parts in the temporary database.
+.TP
 \fBreconf\fR \fIglob\fR [\fIglob2\fR ...]
-Reconfigure port options for the specified ports and reset their information in the temporary database.
+Reconfigure port options for the specified ports.
+The specified ports are re-inspected even when the options are unchanged or undefined.
+All affected ports are inspected again in the following runs by \fBdo\fR or \fBredo\fR command.
 .TP
 \fBforget\fR \fIglob\fR [\fIglob2\fR ...]
 Try to let the temporary database forget about the specified ports as much as possible.
 Concretely, the data on each of the specified ports and their requirements/dependents is unless initially installed or required by other preserved ports.
 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.
 In advance to executing this command, deinstallation for the specified ports should be completed by \fBnoneed add\fR command followed by \fBredo\fR command.
-It is noted that ports registered by \fBok\fR, \fBtaboo\fR and \fBnoneed\fR commands are NOT deleted.
+It is noted that ports registered by \fBok\fR, \fBtaboo\fR, \fBfreeze\fR and \fBnoneed\fR commands are NOT deleted.
 Internal tables used for \fBshow\fR command keep their information regardless of this command.
 .TP
+\fBpkgsanity\fR [\fIglob\fR ...]
+Examine the sanity of installed packages, i.e., whether the installed files exist and match the checksum.
+If arguments \fIglobs\fR are given, only the matching packages are examined.
+For each insane package, the user is queried whether to reinstall it forcedly in the following do/redo runs.
+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.
+Insane packages already assigned to be reinstalled are skipped.
+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.
+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.
+.TP
 \fBescape\fR \fIglob\fR [\fIglob2\fR ...]
 Back up and delete packages specified by \fIglobs\fR for a temporary escape mainly for resolving undeclared conflicts.
 The escaped packages are registered as taboo as same as \fBtaboo add\fR \fIglob\fR [\fIglob2\fR ...].
@@ -161,9 +211,29 @@ The escaped packages are registered as taboo as same as \fBtaboo add\fR \fIglob\
 Restore packages specified by \fIglobs\fR escaped by \fBescape\fR command.
 The escaped packages are deregistered from taboo as same as \fBtaboo del\fR \fIglob\fR [\fIglob2\fR ...].
 .TP
+\fBpackupgrade\fR \fBcreate\fR
+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).
+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).
+Another typical example can be such that the builder is one node of a cluster system and the targets are the other nodes.
+If the execution is terminated before completion, it can be restarted from the terminated point by re-running this command.
+The created packages are saved at ${PACKAGES}/${PKGREPOSITORYSUBDIR}, which is usually /usr/ports/packages/All.
+In order to crop the created set of scripts, \fBpackupgrade\fR \fBcrop\fR command must be executed.
+.TP
+\fBpackupgrade\fR \fBcrop\fR [\fIpath\fR]
+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).
+This command must be executed after completion of \fBpackupgrade\fR \fBcreate\fR command.
+The obtained archive is to be conveyed to the target together with the created packages.
+Then "portsreinstall-upgrade.sh" obtained by extracting the archive is to be run at the target.
+.TP
+\fBpackupgrade\fR \fBclean\fR
+Reset the execution progress of \fBpackupgrade\fR \fBcreate\fR command and discard the internally saved created set of scripts.
+This does not affect any already cropped sets of scripts or created packages.
+This command is provided for cases that ports/packages are reinstalled or reconfigured during/after the execution of \fBpackupgrade\fR \fBcreate\fR command.
+After execution of this command, \fBpackupgrade\fR \fBcreate\fR command will overwrite the packages by creating them again.
+.TP
 \fBshow\fR [\fIsubject\fR] [@[\fBrun\fR|\fBbuild\fR|\fBall\fR][,[\fBdirect\fR|\fBfull\fR]]] [\fIarguments\fR]
 Show the list of ports to be reinstalled.
-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.
+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.
 The default scope is determined by the saved option settings for \fB\-B\fR, \fB\-b\fR and \fB\-o\fR.
 Some \fIsubject\fR's require \fIarguments\fR.
 The following \fIsubject\fR's are available.
@@ -171,63 +241,77 @@ The following \fIsubject\fR's are available.
 .TP
 \fBtodo\fR
 Ports to be reinstalled in the current do/redo process (default).
-With \fB\-a\fR option, the first and second columns denote the origin and initial/new/current package name, respectively.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
 .TP
 \fBdone\fR
 Ports which have been already reinstalled to be up-to-date with their all requirements.
-With \fB\-a\fR option, the first and second columns denote the origin and initial/new/current package name, respectively.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
 .TP
 \fBresolved\fR
 Manually reinstalled ports registered by \fBok\fR command.
-With \fB\-a\fR option, the first and second columns denote the origin and initial/new/current package name, respectively.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
 .TP
 \fBfailure\fR
 Failed ports.
-With \fB\-a\fR option, the first, second and third columns denote the origin, initial/new/current package name, failed make target and manually resolved status (yes or no), respectively.
+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.
 .TP
 \fBredo\fR
 Ports to be reinstalled after success in any of their failed requirements.
-With \fB\-a\fR option, the first and second columns denote the origin and initial/new/current package name, respectively.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
 .TP
 \fBtaboo\fR
 Taboo ports registered by \fBtaboo\fR command.
-With \fB\-a\fR option, the first and second columns denote the origin and initial/new/current package name, respectively.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
+.TP
+\fBfreeze\fR
+Taboo ports registered by \fBfreeze\fR command.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
 .TP
 \fBneed\fR
 Necessary ports registered by \fBneed\fR command.
-With \fB\-a\fR option, the first and second columns denote the origin and initial/new/current package name, respectively.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
 .TP
 \fBnoneed\fR
 Unnecessary ports registered by \fBnoneed\fR command.
-With \fB\-a\fR option, the first and second columns denote the origin and initial/new/current package name, respectively.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
 .TP
 \fBrestored\fR
 Leaf, obsolete or unneeded ports which had been once deleted but are to be or have been restored.
-With \fB\-a\fR option, the first and second columns denote the origin and initial/new/current package name, respectively.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
 .TP
 \fBdeleted\fR
 Leaf, obsolete or unneeded ports are to be or have been deleted.
-With \fB\-a\fR option, the first and second columns denote the origin and initial/new/current package name, respectively.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
 .TP
 \fBconflict\fR
 Conflicting ports which are temporarily deleted.
-With \fB\-a\fR option, the first and second columns denote the origin and initial/new/current package name, respectively.
+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.
 .TP
 \fBrequirements\fR \fIglob1\fR [\fIglob2\fR ...]
 Ports required by matching ports/packages.
-With \fB\-a\fR option, the first, second, third and fourth columns denote the origin of the queried port, initial/new/current package name of the queried port, origin of a requirement of the queried port and initial/new/current package name of the requirement, respectively.
+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.
 .TP
 \fBdependents\fR \fIglob1\fR [\fIglob2\fR ...]
 Ports depending on matching ports/packages.
-With \fB\-a\fR option, the first, second, third and fourth columns denote the origin of the queried port, initial/new/current package name of the queried port, origin of a dependent of the queried port and initial/new/current package name of the dependent, respectively.
+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.
 .TP
 \fBinitrequirements\fR \fIglob1\fR [\fIglob2\fR ...]
 Ports initially required by matching initially installed ports/packages.
-With \fB\-a\fR option, the first, second, third and fourth columns denote the origin of the queried port, package name of the queried port, origin of a requirement of the queried port and package name of the requirement, respectively.
+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.
 .TP
 \fBinitdependents\fR \fIglob1\fR [\fIglob2\fR ...]
 Ports initially depending on matching initially installed ports/packages.
-With \fB\-a\fR option, the first, second, third and fourth columns denote the origin of the queried port, package name of the queried port, origin of a dependent of the queried port and package name of the dependent, respectively.
+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.
+.TP
+\fBconflict_files\fR \fIglob1\fR [\fIglob2\fR ...]
+Possible additional conflict files of matching ports/packages.
+The first and second columns denote the possible conflict package and file path, respectively.
+For officially registered conflict, nothing is outputted.
+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.
+.TP
+\fBstatus\fR \fIglob1\fR [\fIglob2\fR ...]
+Current success/failure status in (re)installation of matching ports/packages.
+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. 
 .RE
 .SH OPTIONS
 If duplicated or conflicting ones are set, the last ones are effective.
@@ -286,6 +370,13 @@ Reset option settings for minor controls.
 Option settings for group 4 are once reset and replaced with the newly specified ones.
 Check the saved options by \fBportsreinstall options\fR command before specifying this option.
 .PD
+.IP \fB\-S\fR
+.PD 0
+.TP
+\fB\-\-no\-opening\-message\fR
+Suppress the credit and opening messages.
+Option \fB\-a\fR takes higher priority over this option.
+.PD
 .SS Group 3: Effective only with redo command
 .IP \fB\-L\fR
 .PD 0
@@ -326,14 +417,15 @@ This option affects behaviors of \fB\-t\fR, \fB\-T\fR and \fB\-q\fR options.
 .PD 0
 .TP
 \fB\-\-include\-buildtime\-dependencies\fR
-Include build-time dependencies in evaluation of dependencies.
+Include build\-time dependencies in evaluation of dependencies.
 This option affects behaviors of \fB\-t\fR, \fB\-T\fR and \fB\-q\fR options.
 .PD
 .IP \fB\-C\fR
 .PD 0
 .TP
 \fB\-\-apply\-default\-config\fR
-The temporary database is built by skipping executing \fBmake config\fR and applying default values for unconfigured port options.
+The temporary database is built by skipping executing \fBmake config\-conditional\fR so that the port options are unchanged.
+The default values are applied to unconfigured port options.
 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)).
 .PD
 .IP \fB\-c\fR
@@ -360,21 +452,42 @@ With this option specified, distfiles for ports are deleted unless they are init
 \fB\-\-keep\-distfiles\fR
 Do not clean up obsolete or unused distfiles.
 .PD
+.IP \fB\-F\fR
+.PD 0
+.TP
+\fB\-\-fetch\-only\fR
+Execute fetch and checksum verification only at the (re)installation process for each port.
+Packages are also fetched if applicable.
+Regardless of this mode, missing essential tools for package management such as \fBpkg\fR(8) and \fBdialog4ports\fR(1) will be installed.
+.PD
+.IP \fB\-f\fR
+.PD 0
+.TP
+\fB\-\-disallow\-force\-continuation\-for\-looped\-dependency\fR
+Disallow forcible continuation in case that looped dependencies are found.
+Without this option, workarounds are carried out at the phase of "Completion of *-time requirement lists" of the preparation stage.
+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.
+.PD
 .IP \fB\-G\fR
 .PD 0
 .TP
 \fB\-\-use\-prebuilt\-package\fR
-Use prebuilt packages for ports with the default configurations, i.e., that no part option is changed from the default, no knob (make environment variable or make argument) is defined, and no replacement or update is made to required ports.
-The actual merit of this option depends on the service levels and qualities of the remote package sites; As of May, 2013, the official sites have provided legacy packages only for each release timing and pkgng packages for only three ports (ports-mgmt/pkg, ports-mgmt/poudriere and ports-mgmt/poudriere-devel); thus this option is useful for new installation and otherwise not so effective.
-This option can be inconvenient for ports whose dependencies on other packages, files or other system-specific values are automatically arranged during the build or installation processes by detection outside of control by port options, knobs or ports replacement.
+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 .
+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.
+It is noted that some ports still may be problematic with this assumption by automatic dependencies on other system configurations.
 This problem can be resolved by configuring NOPKG_* section in ${LOCALBASE}/etc/portsreinstall.conf.
+.RS
+Historical background:
+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.
+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.
+.RE
 .PD
 .IP \fB\-g\fR
 .PD 0
 .TP
 \fB\-\-suppress\-pkgtools\-upadte\fR
 Keep indispensable packages for the standard function of the ports/packages system untouched.
-Concretely, this option suppresses upgrade, de/re-installation of the currently installed ports-mgmt/pkg and ports-mgmt/dialog4ports.
+Concretely, this option suppresses upgrade, de/re-installation of the currently installed ports-mgmt/pkg(\-devel) and ports-mgmt/dialog4ports.
 .PD
 .IP \fB\-I\fR
 .PD 0
@@ -394,8 +507,8 @@ This option suppresses upgrade, deinstallation and reinstallation of the current
 .PD 0
 .TP
 \fB\-use\-legacy\-package\-for\-missing\-pkgng\fR
-If prebuilt pkgng packages are missing, use corresponding legacy ones instead and convert them to pkgng using \fBpkg2ng\fR.
-This option is effective only when \fB\-G\fR option is enabled and pkgng is used for the current packages system.
+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.
+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.
 .PD
 .IP \fB\-n\fR
 .PD 0
@@ -428,6 +541,13 @@ If you desire to uninstall them, do it manually.
 Automatically deselect all candidates for deinstallation of leaf or obsolete ports.
 This option conflicts with \fB\-Y\fR option.
 .PD
+.IP \fB\-x\fR
+.PD 0
+.TP
+\fB\-\-no\-exec\-inst\-script\fR
+Execution of scripts in pre-installation, post-installation and deinstallation defined for each package is skipped.
+This option is suitable for package build in \fBportsreinstall\-chroot\fR(8) or other change-rooted/jailed environment.
+.PD
 .IP \fB\-Y\fR
 .PD 0
 .TP
@@ -442,8 +562,10 @@ Reset of the saved values for this group is available in the initial run of \fBr
 .PD 0
 .TP
 \fB\-\-target\-only\-itself=\fR\fIglob1\fR[\fB:\fIglob2\fR[\fB:\fR...]]
-Restrict (re/de)installation within a scope consisting of the specified target ports and their missing build-time requirements.
+Restrict (re/de)installation within a scope consisting of the specified target ports and their missing build\-time requirements.
 Available ports matching the specified target globs are automatically registered as necessary ports equivalently to \fBportsreinstall need add\fR command.
+Records of successful (re)installation for the all ports in the scope are deleted so that they are to be reinstalled forcedly.
+So this option is usable for fixing packages whose data in the package database or content files are broken.  
 Without \fB\-i\fR option, target ports must be already installed or inspected.
 Without \fB\-o\fR option, the temporary database is maintained to have complete data on dependencies of all installed and necessary ports.
 Combination with options \fB\-T\fR and \fB\-t\fR is available.
@@ -455,9 +577,9 @@ The behavior can be modified by \fB\-B\fR, \fB\-b\fR, \fB\-i\fR and \fB\-o\fR op
 \fB\-\-only\-target\-scope\fR
 Ignore ports which are outside of target scopes of \fB\-O\fR, \fB\-T\fR or \fB\-t\fR options.
 Inspection of dependencies is made within the least-required scope for (re)installing the targets.
-If given with \fB\-O\fR, targets themselves and their missing direct build-time requirements are in the scope.
-If given with \fB\-T\fR, targets themselves, their direct requirements and their missing direct build-time requirements are in the scope.
-If given with \fB\-t\fR, targets themselves, their already-inspected dependents and their missing direct build-time requirements are in the scope.
+If given with \fB\-O\fR, targets themselves and their missing direct build\-time requirements are in the scope.
+If given with \fB\-T\fR, targets themselves, their direct requirements and their missing direct build\-time requirements are in the scope.
+If given with \fB\-t\fR, targets themselves, their already-inspected dependents and their missing direct build\-time requirements are in the scope.
 Ports outside of the scopes are kept untouched even if they are updated.
 It is noted that this option disables detection and deinstallation of new leaf ports.
 This option will be useful for quick upgrades or new installation (only) before complete construction of the temporary database for the all installed ports.
@@ -466,8 +588,10 @@ This option will be useful for quick upgrades or new installation (only) before
 .PD 0
 .TP
 \fB\-\-target\-and\-requirements=\fR\fIglob1\fR[\fB:\fIglob2\fR[\fB:\fR...]]
-Restrict (re/de)installation within a scope consisting of the specified target ports, their requirements and their missing build-time requirements.
+Restrict (re/de)installation within a scope consisting of the specified target ports, their requirements and their missing build\-time requirements.
 Available ports matching the specified target globs are automatically registered as necessary ports equivalently to \fBportsreinstall need add\fR command.
+Records of successful (re)installation for the all ports in the scope are deleted so that they are to be reinstalled forcedly.
+So this option is usable for fixing packages whose data in the package database or content files are broken.  
 Without \fB\-i\fR option, target ports must be already installed or inspected.
 Without \fB\-o\fR option, the temporary database is maintained to have complete data on dependencies of all installed and necessary ports.
 Combination with options \fB\-T\fR and \fB\-t\fR is available.
@@ -477,8 +601,10 @@ The behavior can be modified by \fB\-B\fR, \fB\-b\fR, \fB\-i\fR and \fB\-o\fR op
 .PD 0
 .TP
 \fB\-\-target\-and\-dependents=\fR\fIglob1\fR[\fB:\fIglob2\fR[\fB:\fR...]]
-Restrict (re/de)installation within a scope consisting of the specified target ports, their dependents and their missing build-time requirements.
+Restrict (re/de)installation within a scope consisting of the specified target ports, their dependents and their missing build\-time requirements.
 Available ports matching the specified target globs are automatically registered as necessary ports equivalently to \fBportsreinstall need add\fR command.
+Records of successful (re)installation for the all ports in the scope are deleted so that they are to be reinstalled forcedly.
+So this option is usable for fixing packages whose data in the package database or content files are broken.  
 Without \fB\-i\fR option, target ports must be already installed or inspected.
 Without \fB\-o\fR option, the temporary database is maintained to have complete data on dependencies of all installed and necessary ports.
 Combination with options \fB\-T\fR and \fB\-t\fR is available.
@@ -529,7 +655,7 @@ Nevertheless, the all functionalities of this utility is applicable to any situa
 In a standard case, the entire reinstallation will proceed in the following step:
 .TP
 1.
-Update the ports tree and (in case of pkgng) the pkgng repository catalog;
+Update the ports tree and (except in case of the legacy package system) the \fBpkg\fR(8) repository catalog;
 .PD
 .TP
 2.
@@ -553,15 +679,15 @@ Execute the actual (re/de)installation (\fBdo\fR run);
 .PD
 .TP
 7.
-If some ports failed, retry the (re/de)installation for the failed ones and their dependents (\fBredo\fR run);
+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.).
 .PD
 .TP
 8.
-Make modification to the temporary database or manually re/de-install packages in concern (\fBok\fR, \fBtaboo\fR, \fBnoneed\fR, etc.).
+Execute the retrial of the (re/de)installation (\fBredo\fR run);
 .PD
 .TP
 9.
-Repeat from 6 to 7 until the all available ports succeed.
+Repeat from 7 to 8 until the all available ports succeed.
 .PD
 .PP
 A typical instance of actually executed commands for upgrading packages will be in the following flow:
@@ -573,7 +699,7 @@ A typical instance of actually executed commands for upgrading packages will be
 2.
 .B pkg update
 .RS
-(In case of pkgng)
+(No need for the legacy packages system)
 .RE
 .PD
 .TP
@@ -592,28 +718,21 @@ A typical instance of actually executed commands for upgrading packages will be
 .PD
 .TP
 5.
-.B portsreinstall redo
-.RS
-(Possibly end up with some failed ports)
-.RE
-.PD
-.TP
-6.
  ... Countermeasure to failures ...
 .PD
 .TP
-7.
+6.
 .B portsreinstall redo
 .RS
 (Possibly end up with some failed ports)
 .RE
 .PD
 .TP
-8.
- ... Repetition from 7 to 8 ...
+7.
+ ... Repetition from 6 to 7 ...
 .PD
 .TP
-9.
+8.
 .B portsreinstall redo
 .RS
 (All available ports succeed)
@@ -695,10 +814,57 @@ Then following execution of
 .B portsreinstall
 .RE
 deinstalls newly selected packages and restores unselected ones.
+.SS Package build in a chroot system
+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.
+.SS Port upgrading of a cluster system
+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.
+The conventional flow will be as follows:
+.PP
+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.
+.PP
+2. In the builder node, update the ports tree and the package repository catalog.
+.RS
+root@[builder.cluster.intranet]
+.B portsnap fetch update
+.RE
+.RS
+root@[builder.cluster.intranet]
+.B pkg update
+.RE
+3. Upgrade the all pakages completely by \fBportsreinstall\fR (the command line options are just an example).
+.RS
+root@[builder.cluster.intranet]
+.B portsreinstall -qC
+.RE
+4. Create the packages and dispatching script set. This process can be skipped when \fBportsreinstall-chroot\fR(8) was used in the previous stage.
+.RS
+root@[builder.cluster.intranet]
+.B portsreinstall packupgrade create
+.RE
+5. Crop and extract the archive of the created dispatching script set.
+.RS
+root@[builder.cluster.intranet]
+.B portsreinstall packupgrade crop /home/admin/portsreinstall-upgrade.tar.gz
+.RE
+.RS
+root@[builder.cluster.intranet]
+.B rm -rf /home/admin/portsreinstall-upgrade
+.RE
+.RS
+root@[builder.cluster.intranet]
+.B mkdir -p /home/admin/portsreinstall-upgrade
+.RE
+.RS
+root@[builder.cluster.intranet]
+.B tar xzf /home/admin/portsreinstall-upgrade.tar.gz -C /home/admin/portsreinstall-upgrade
+.RE
+6. Execute the dispatched script at each target node.
+.RS
+.B ssh -l admin target01.cluster.intranet sudo /home/admin/portsreinstall-upgrade/portsreinstall-upgrade.sh
+.RE
 .SS Workaround for failed ports: conflicts: case 1
 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.
 This means that ports lacking proper CONFLICTS, CONFLICTS_BUILD and CONFLICTS_INSTALL definitions may undergo failures.
-Some of the undeclared conflicts may be resolved by simple redo runs.
 .PP
 Some problems may be due to coexistence of the same or related software of different versions of the requirements or the unsuccessful ports themselves.
 For analysis of the upgraded and initial requirements,
@@ -783,7 +949,6 @@ Then execute
 for automatic evaluation and deinstallation of new leaf ports redefined by the new unnecessary ports.
 If the registered ports are required by any non-leaf or non-unnecessary ports, this process will end up with no practical progress.
 .SS Workaround for failed ports: reconfiguration of port options
-.PP
 If the problems may be resolved by reconfiguration of the port options, execute
 .B portsreinstall reconf 
 .I glob
@@ -796,7 +961,7 @@ If any change was made here, execute
 .RE
 for retrial of (re)installation.
 .SS Workaround for failed ports: reconfiguration of knobs
-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 MARG_*, MENV_*, BEFOREBUILD_*, BEFOREDEINSTALL_* or AFTERINSTALL_* values.
+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.
 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).
 .PP
 Then execute
@@ -807,6 +972,26 @@ Then execute
 (Recover options reset by \fB\-L\fR if any by checking with the aid of \fBportsreinstall options\fR.)
 .RE
 for (re)installation of the concerned port by reflecting the configuration changes.
+.SS Workaround for failed ports: update of ports tree
+If the ports are fundamentally broken, updating the ports tree may fix the problems.
+In this case, execute
+.RS
+.B portsnap fetch update
+.RE
+and, followed by
+.RS
+.B pkg update
+.RE
+and then
+.RS
+.B portsreinstall reset keepstatus
+.RE
+to clean everything but the option settings, information of the initially installed packages and the progress of unchanged successful ports.
+Then execute
+.RS
+.B portsreinstall
+.RE
+and see whether the problems are resolved.
 .SH "ENVIRONMENT VARIABLES"
 The following environment variables can be used to change the behavior of \fBportsreinstall\fR.
 Some of them are the same as defined in \fBports\fR(7).
@@ -888,259 +1073,537 @@ Configuration file of \fBportupgrade\fR(1).
 .SH HISTORY
 \fBportsreinstall\fR has been developed as below.
 .TP
-3.0.1 (? June 2013)
+4.0.1 (?? July 2018)
+.RS
+[NEW] Option \fB\-x\fR is added.
+.PP
+[IMPROVED] The (Re)installation scheme is changed to skip ports whose requirements are not installed at their turns .
+.PP
+[IMPROVED] It is changed to detect unflavored ports or ports with old flavor names of flavored ports as obsolete.
+.PP
+[IMPROVED] The behavior with union file systems is stabilized.
+.PP
+[IMPROVED] It is changed to show messages of reset ports at the stage of reloading ${LOCALBASE}/etc/portsreinstall.conf.
+.PP
+[IMPROVED] It is changed so that ports to freeze are upgraded to the latest available package version.
+.PP
+[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.
+.PP
+[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.
+.PP
+[BUG FIX] Evaluation of old origins was incomplete for merged ports and resulted in redundant detection of conflict.
+.PP
+[BUG FIX] Failure in unmounting of file systems by \fBportsreinstall\-chroot\fR(8) left the privilege lock.
+.RE
+.TP
+4.0.0 (29 June 2018)
+.RS
+[NEW] Flavor is supported. Related to this feature, representations of port origins without flavor is recognized to exactly match the unflavored ones.
+.PP
+[NEW] Option \fB\-F\fR is added.
+.PP
+[NEW] \fBpackupgrade\fR command is added.
+.PP
+[NEW] \fBreset keepstatus\fR command is added.
+.PP
+[NEW] \fBfreeze\fR and \fBshow freeze\fR commands are added. FREEZE section is added to ${LOCALBASE}/etc/portsreinstall.conf.
+.PP
+[NEW] \fBshow conflict_files\fR\fR command is added.
+.PP
+[NEW] CONFLICT section is added to ${LOCALBASE}/etc/portsreinstall.conf.
+.PP
+[NEW] Utilities of \fBportsreinstall-upgrade\fR(8) and \fBportsreinstall-chroot\fR(8) are added.
+.PP
+[NEW] Change of port options made outside of \fBportsreinstall\fR(8) is automatically detected.
+.PP
+[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.
+.PP
+[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.
+.PP
+[IMPROVED] \fBreset\fR command is improved to reset the database cleaner and preserve manually set taboo/freeze/need/noneed lists.
+.PP
+[IMPROVED] \fBreconf\fR command is changed to be available any time.
+.PP
+[IMPROVED] Inspection of merged ports is improved to make the deinstallation of old packages effective.
+.PP
+[BUG FIX] \fBpkgsanity\fR command had lost its ability to detect missing files because of the specification change of \fBpkg\fR(8).
+.PP
+[BUG FIX] Command line arguments could have interpreted "add" keyword as a glob matching math/add.
+.PP
+[BUG FIX] Option \fB\-k\fR did not work properly with option \fB\-g\fR.
+.RE
+.TP
+3.3.2 (15 February 2017)
+.RS
+.PP
+[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.
+.PP
+[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.
+.RE
+.TP
+3.3.1 (18 August 2016)
+.RS
+[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.
+.PP
+[BUG FIX] Error messages from failed detection of option configuration were not output.
+.RE
+.TP
+3.3.0 (10 July 2016)
+.RS
+[NEW] Option \-f is added.
+.PP
+[IMPROVED] Automatic workaround of looped dependencies is implemented at the phase of "Completion of *-time requirement lists" in the preparation stage.
+.PP
+[CHANGED] Dependencies on \fBpkg\fR(8) is changed to be ignored.
+.PP
+[BUG FIX] The rescue process for cases missing \fBpkg\fR(8) was not working well.
+.PP
+[BUG FIX] The phase of "Completion of *-time requirement lists" in the preparation stage was caught into an infinite loop when looped dependencies exist.
+.PP
+[BUG FIX] Comments on termination were unavailable in some phases.
+.PP
+[BUG FIX] The messages of currently installed packages may have shown duplicated ones.
+.RE
+.TP
+3.2.1 (27 January 2015)
+.RS
+[BUG FIX] The automatic resolution of installation conflict implemented in the previous version was seriously broken and judged conflicts incorrectly.
+.RE
+.TP
+3.2.0 (30 December 2014)
+.RS
+[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.
+.PP
+[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.
+.PP
+[BUG FIX] Reinstallation of \fBpkg\fR(8) could encounter error termination.
+.RE
+.TP
+3.1.1 (17 December 2014)
+.RS
+[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).
+.PP
+[BUG FIX] MOVED or REPLACED ports were sometimes incorrectly detected as duplicated ports.
+.PP
+[BUG FIX] Command \fBpkgsanity\fR was confused by the specification change of \fBpkg\-check\fR(8).
+.PP
+[BUG FIX] Option \fB\-q\fR did not work correctly in version 3.1.0.
+.RE
+.TP
+3.1.0 (9 August 2014)
+.RS
+[IMPROVED] Command \fBreset\fR is now available to work with an updated ports tree by preserving information of the initially installed packages.
+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.
+.PP
+[IMPROVED] A countermeasure operation is implemented for a bug of pkg-1.3.4 that \fBpkg delete \-q\fR does not work.
+.PP
+[IMPROVED] Revisions are made so that packages whose ports are replaced or moved are deinstalled before installation of the alternative ports.
+.PP
+[IMPROVED] Reinstalltion of ports-mgmt/pkg becomes smarter in systems where Pkgng is the default.
+.PP
+[BUG FIX] Command \fBprepare\fR was possibly aborted at a port any of whose requirements or dependents is obsolete.
+.PP
+[BUG FIX] It silently failed to launch if the ports tree is missing or broken.
+.PP
+[BUG FIX] The short help lacked descriptions on \fBneed\fR command.
+.PP
+[BUG FIX] Some message output failed with a warning "3: Bad file descriptor" in some environment (detected in 10.0-RELEASE).
+.PP
+[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).
+.PP
+[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).
+.PP
+[BUG FIX] Reload of configuration where replacement rule is changed possibly caused errors in the phase of "Inspection of necessity".
+.PP
+[BUG FIX] Messages about failed ports were inappropriate when failed ports were changed to unneeded.
+.PP
+[BUG FIX] Evaluation of glob was incorrect when the pattern is regular expression containing multiple slashes.
+.PP
+[BUG FIX] Warning messages might have arise by attempting to restore nonexistent backed\-up requirements.
+.PP
+[BUG FIX] The error message for invalid operation on \fBreselect\fR command was wrong.
+.PP
+[BUG FIX] Selection of leaf packages remained after all of them changed to non\-leaves.
+.PP
+[BUG FIX] Ports with periods or underscores in their package name, port name or origin were not be treated correctly.
+.PP
+[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.
+.PP
+[BUG FIX] Execution of \fBreset\fR command unintentionally removed temporally deinstalled leaf ports out of scope of reinstallation.
+.PP
+[BUG FIX] A wrong option was given to \fBpkg-info(8)\fR in a compatible command for \fBpkg_info \-qoX\fR.
+.PP
+[BUG FIX] Variables "NOPKG_*" in ${LOCALBASE}/etc/portsreinstall.conf were not parsed.
+.RE
+.TP
+3.0.5 (14 December 2013)
+.RS
+[NEW] Command of \fBrmconf\fR is added.
+.PP
+[IMPROVED] Automatic resolution of duplicated registrations of multiple packages for the same port origin is implemented in \fBpkgsanity\fR command.
+.PP
+[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.
+.PP
+[BUG FIX] Execution of \fBreconf\fR command confused the work of \fB\-G\fR option.
+.PP
+[BUG FIX] Escaped packages by \fBescape\fR command were unintentionally reinstalled in (re)installation of their dependents.
+.RE
+.TP
+3.0.4 (16 November 2013)
+.RS
+[IMPROVED] Support for systems in which pkgng is the default or legacy package tools are abandoned is improved.
+.PP
+[IMPROVED] Changes are made so that MAKE_JOBS_UNSAFE=yes is set in retrials of build and installation.
+.PP
+[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.
+.PP
+[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.
+.PP
+[BUG FIX] The execution was terminated by error when /etc/make.conf does not exist.
+.PP
+[BUG FIX] The execution was terminated by error when there is no INDEX file for the current OS version is prepared.
+.PP
+[BUG FIX] Some meaningless warnings are suppressed.
+.PP
+[BUG FIX] Comments at termination during building the temporary database were inconsistent.
+.RE
+.TP
+3.0.3 (2 August 2013)
+.RS
+[BUG FIX] Cleaning of distfiles before retrial of failed fetch was forgotten.
+.RE
+.TP
+3.0.2 (10 July 2013)
+.RS
+[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
+.RS
+\fBportsreinstall pkgsanity\fR
+.RE
+and select "y" in the queries for spoiled packages.
+.PP
+[NEW] Commands of \fBpkgsanity\fR and \fBshow status\fR are added.
+.PP
+[IMPROVED] Changes are made so as to deinstall conflicts before the first trials in build and installation.
+.PP
+[IMPROVED] Changes are made so as to prevent restoration of backed-up packages deinstalled due to matching CONFLICTS_INSTALL of installed packages.
+.PP
+[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.
+.PP
+[IMPROVED] Command \fBshow conflict\fR is changed to append a column of opponent ports of each conflict.
+.PP
+[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.
+.PP
+[MISC] Minor changes are made on HISTORY section of the manual page in the level of coding and terminology.
+.PP
+[BUG FIX] Configuration changes in replacement were not completely reflected by redo with \fB\-L\fR option and ended up with errors.
+.PP
+[BUG FIX] Deinstallation of obsolete or new leaf ports did not work in version 3.0.1.
+.PP
+[BUG FIX] Conflicts escape was not implemented for (re)installation by prebuilt packages.
+.PP
+[BUG FIX] The message format in enumerating port origins or so on was broken.
+.RE
+.TP
+3.0.1 (11 June 2013)
+.RS
 [NEW] Commands \fBescape\fR and \fBrestore\fR are added.
-
+.PP
 [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).
-
-[IMPROVED] Changes are made so that installation by packages is split into fetch and installation stages and backup/restoration of old packages are skipped if the fetch is unsuccessful.
-
+.PP
+[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.
+.PP
 [IMPROVED] Changes are made so that uninspected ports are skipped in \fBreconf\fR command.
-
-[IMPROVED] Correspondence to cases of duplicated packages for the same port is implemented.
-
+.PP
+[IMPROVED] A measure to cases of duplicated packages for the same port is implemented.
+.PP
 [BUG FIX] Commands permitted for unprivileged users did not work for the users.
-
+.PP
 [BUG FIX] This manual page, comments and messages contained some wrong English words and incorrect descriptions.
-
+.PP
 [BUG FIX] Runs by unprivileged users could end up with errors in message output if /dev/stdin cannot provide information of the console size.
-
+.PP
 [BUG FIX] Meaningless warnings are suppressed.
-
+.PP
 [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.
-
+.PP
 [BUG FIX] Evaluation of glob patterns which have the form of port origin was inappropriately ambiguous.
-
+.PP
 [BUG FIX] Reinstallation processes were unintentionally terminated when the backup package creation was unsuccessful.
-
+.PP
 [BUG FIX] Options \fB\-O\fR, \fB\-T\fR and \fB\-t\fR did not work for once-succeeded ports.
+.PP
+[BUG FIX] Detection of conflict was overestimated for some ports.
+.RE
 .TP
 3.0.0 (01 June 2013)
+.RS
 [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).
-
+.PP
 [NEW] Long options are supported.
-
+.PP
 [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.
-
+.PP
 [NEW] (Re)installation by prebuilt packages for ports with default configurations is implemented.
-
+.PP
 [NEW] Controlling the dependency scope for \fBshow\fR command becomes available. 
-
+.PP
 [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.
-
+.PP
 [CHANGED] The function of \fBshow redo\fR is replaced with that of former \fBshow pending\fR, and \fBshow pending\fR is abandoned in exchange.
-
+.PP
 [CHANGED] Deinstallation of obsolete packages becomes selectable by run\-time dialog.
-
+.PP
 [CHANGED] Deinstallation and ignorance of leaf ports becomes available via selection by run\-time dialog.
-
+.PP
 [CHANGED] The directory for saving packages of obsolete or removed leaf ports are changed to $PACKAGES/All whose default is /usr/ports/packages/All.
-
+.PP
 [CHANGED] The deinstallation process for unused packages which have been done before reinstallation is changed to be done after it.
-
+.PP
 [CHANGED] Compact forms of options is made to be accepted, e.g., \fB\-b \-t \-o\fR as \fB\-bto\fR.
-
-[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.
-
+.PP
+[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.
+.PP
 [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.
-
+.PP
 [CHANGED] Old options of \fB\-x\fR and \fB\-X\fR are abandoned due to duplication with \fBtaboo add\fR command.
-
+.PP
 [CHANGED] Rules for transferring option settings to restarted runs are changed so as to let the all options renewable.
-
+.PP
 [CHANGED] The evaluation algorithm of glob patterns is improved and changed to be fully original.
-
+.PP
 [CHANGED] The long help is unified with this manual page.
-
+.PP
 [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.
-
+.PP
 [IMPROVED] The treatment of backup packages is modified to be safer by considering possible format fluctuation in case of pkgng.
-
+.PP
 [IMPROVED] Automatic solution to conflicts in (re)installation is implemented.
-
+.PP
 [MISC] Line feeds of the help and information messages are improved.
-
+.PP
 [BUG FIX] Meaningless warnings at the end of leaf ports are suppressed.
-
+.PP
 [BUG FIX] Inappropriate operations could have been attempted on the temporary database by non-superuser privilege.
-
+.PP
 [BUG FIX] Tarballs for ports which depend on other ports could have been lost in the step of cleaning distfiles.
-
+.PP
 [BUG FIX] Self-upgrade was carried out even for commands other than do or prepare.
+.RE
 .TP
 2.2.2 (03 January 2013)
+.RS
 [BUG FIX] Commands \fBok add\fR and \fBok del\fR failed if no port has reinstalled in the latest do/redo process.
-
+.PP
 [BUG FIX] Makefile was problematic if ${LOCALBASE}/etc/portsreinstall.conf does not exist before installation.
+.RE
 .TP
 2.2.1 (25 December 2012)
+.RS
 [CHANGED] Command \fBshow todo_next\fR is renamed to \fBshow pending\fR.
-
+.PP
 [IMPROVED] Changes are made so as to avoid retrying for dependents of failed ports when no problem has resolved.
-
+.PP
 [BUG FIX] Removed a remained debugging code in the action for \fBsave\fR command.
+.RE
 .TP
 2.2.0 (17 December 2012)
+.RS
 [NEW] Command of \fBshow todo_next\fR is added.
-
+.PP
 [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.
-
+.PP
 [CHANGED] The default settings in portsreinstall.conf was changed so as to include a HOLD pattern for bsdpan.
-
+.PP
 [BUG FIX] There was a problem in evaluating glob patterns expressing origins.
-
+.PP
 [BUG FIX] Minor inappropriate messages and actions emerged when the target and replacement of ports substitution become the same.
-
+.PP
 [BUG FIX] The help messages and this manual page lacked the descriptions about \fBshow redo\fR command.
+.RE
 .TP
 2.1.0 (10 December 2012)
+.RS
 [NEW] New generation package (pkgng) is supported.
-
+.PP
 [IMPROVED] A countermeasure for a build failure in a restarted build from a terminated build is implemented.
-
+.PP
 [BUG FIX] Restoration of backup packages after failed installation was not working correctly.
-
+.PP
 [BUG FIX] The transferring mechanism of option values to restarted run was broken.
-
+.PP
 [BUG FIX] Error end in case that no packages are installed is fixed.
-
+.PP
 [BUG FIX] A glob evaluation routine used when \fBports_glob\fR(1) is not installed was broken.
+.RE
 .TP
 2.0.0 (12 August 2012)
+.RS
 [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.
-
+.PP
 [NEW] Commands of \fBshow requirements\fR and  \fBshow dependents\fR are added.
-
+.PP
 [NEW] A functionality of self-upgrade is added so as to be carried out first if the port of portsreinstall is new.
-
+.PP
 [NEW] Option \fB\-k\fR is added for cases that upgrade of portsreinstall should be avoided.
-
+.PP
 [IMPROVED] Messages are extended to output configuration parameter values.
-
+.PP
 [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.
-
+.PP
 [CHANGED] Use of commas as delimiters in \fBok\fR and \fBtaboo\fR commands is abolished.
-
+.PP
 [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.
-
+.PP
 [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.
-
+.PP
 [BUG FIX] Termination message is corrected (portsreinstall ok => portsreinstall ok add).
-
+.PP
 [BUG FIX] Values of BEFOREBUILD, BEFOREDEINSTALL and AFTERINSTALL were not correctly imported from \fBpkgtools.conf\fR(5).
-
+.PP
 [BUG FIX] The file name given by save command was with a wrong time stamp.
+.RE
 .TP
 1.1.0 (28 April 2012)
+.RS
 [NEW] Command of show deleted is newly added.
-
+.PP
 [CHANGED] Origin names in messages and results of show command are changed to be accompanied with package names.
-
+.PP
 [CHANGED] The default option for treating \fBpkgtools.conf\fR(5) is changed to \fB\-p\fR and \fB\-Q\fR is newly added.
-
+.PP
 [IMPROVED] Custom make environment variables and arguments are changed to be reflected in the stage of inspection of dependencies.
-
+.PP
 [IMPROVED] Command of show todo is now available before starting reinstallation.
-
+.PP
 [BUG FIX] Independence from \fBportupgrade\fR(1) was incomplete.
-
+.PP
 [BUG FIX] Error messages for show command when the temporary database does not exist are improved.
-
+.PP
 [BUG FIX] Ports with names contaning '+' were not correctly treated.
-
+.PP
 [BUG FIX] Save and load commands were broken.
-
+.PP
 [BUG FIX] Deletion of MOVED-back packages is now prevented.
+.RE
 .TP
 1.0.0 (14 March 2012)
+.RS
 [MISC] Explanations for \fB\-p\fR and \fB\-P\fR are revised because the previous ones were somewhat confusing.
-
+.PP
 [MISC] The output device of helps is changed from stderr to stdout.
-
+.PP
 [MISC] Messages for termination during deinstallation and reinstallation are improved by showing the target port/package names at that time.
-
+.PP
 [BUG FIX] Glob patterns for package/port names were not fully supported.
-
+.PP
 [BUG FIX] Values of MARG_* and MENV_* (MAKE_ARGS and MAKE_ENV in \fBpkgtools.conf\fR(5)) were not working.
-
+.PP
 [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.
-
+.PP
 [BUG FIX] Values of IGNORE_MOVED partially overwrote HOLD_PKGS in \fBpkgtools.conf\fR(5).
-
+.PP
 [BUG FIX] Typographic and grammatical errors in the main script and documents are revised.
+.RE
 .TP
 0.13.1 (29 October 2011)
+.RS
 [BUG FIX] Inspection of missing ports was incomplete.
-
+.PP
 [BUG FIX] Origin names with '+' were not correctly treated.
-
+.PP
 [IMPROVED] Inspection of dependencies of installed packages gets faster.
+.RE
 .TP
 0.13.0 (28 August 2011)
+.RS
 [IMPROVED] Phase of "Order the ports considering dependencies" is accelerated.
+.RE
 .TP
 0.12.0 (22 June 2011)
+.RS
 [NEW] \fB\-q\fR, \fB\-d\fR and \fB\-N\fR options are added.
-
+.PP
 [CHANGED] Settings for \fB\-x\fR and \fB\-s\fR options becomes to be transferred to restarted runs.
+.RE
 .TP
 0.11.0 (17 May 2011)
+.RS
 [NEW] Causes of errors are added to the report of failed ports.
-
+.PP
 [CHANGED] Functionality of \fB\-t\fR option is changed and partly splitted into \fB\-T\fR.
-
+.PP
 [IMPROVED] Refetch after fetch failure becomes smarter so as not to clean up distfiles.
-
+.PP
 [MISC] Terminology 'abort' is corrected to be 'terminate'.
+.RE
 .TP
 0.10.0 (11 Mar 2011)
+.RS
 [NEW] Version check for temporary database and portupgrade is added (as a template).
-
+.PP
 [BUG FIX] Old packages for ports whose package names was renamed were not deleted.
-
+.PP
 [BUG FIX] Duplicated cleans were executed after successful installation.
+.RE
 .TP
 0.9.8 (02 Mar 2011)
+.RS
 [MISC] Installation methods of non-executable files in Makefile are improved again.
+.RE
 .TP
 0.9.7 (02 Mar 2011)
+.RS
 [MISC] Installation methods of non-executable files in Makefile are improved.
+.RE
 .TP
 0.9.6 (01 Mar 2011)
+.RS
 [BUG FIX] Fix at version 0.9.5 was incomplete.
-
+.PP
 [BUG FIX] The release date of 0.9.5 was wrong in the manpage.
+.RE
 .TP
 0.9.5 (28 Feb 2011)
+.RS
 [BUG FIX] "install" target in Makefile installed non-executable files as executables.
+.RE
 .TP
 0.9.4 (17 Jan 2011)
+.RS
 [BUG FIX] "all" target in Makefile was missing.
+.RE
 .TP
 0.9.3 (16 Jan 2011)
+.RS
 [MISC] Makefile is modified to compress manpage in the build process.
+.RE
 .TP
 0.9.2 (10 Jan 2011)
+.RS
 [MISC] The 2-Clause BSD License is applied from this version.
-
+.PP
 [NEW] Manpage is created.
-
+.PP
 [NEW] Makefile for installation/uninstallation is added.
-
+.PP
 [BUG FIX] Recovery from distfile checksum error was broken.
+.RE
 .TP
 0.9.1 (27 Dec 2010)    
+.RS
 [BUG FIX] Wrong warning for \fB\-p\fR/\fB\-P\fR options in the first run.
-
+.PP
 [BUG FIX] Broken support of recursive chase of MOVED ports.
-
+.PP
 [BUG FIX] Option configuration menus were not accessable.
-
+.PP
 [BUG FIX] The mechanism of loading the configuration file was broken.
-
+.PP
 [BUG FIX] Optionally added taboo ports were not always effective in restart.
+.RE
 .TP
 0.9.0 (21 Nov 2010)
+.RS
 First version.
 .SH APPENDIX: Conditions determining the package system (general specification of FreeBSD Ports/Packages)
 The current package system is automatically detected according to the OS version whose serial number is obtained by
@@ -1155,32 +1618,43 @@ In order to choose pkgng in systems from 800505 (just before 8.1-RELEASE) to jus
 .RS
 .B WITH_PKGNG=yes
 .RE
+.RS
+or
+.RE
+.RS
+.B WITH_PKG=yes
+.RE
 in /etc/make.conf.
-
+.PP
 In order to choose the legacy one in systems of 1000017 (10-CURRENT) or later, put
 .RS
 .B WITHOUT_PKGNG=yes
 .RE
+.RS
+or
+.RE
+.RS
+.B WITHOUT_PKG=yes
+.RE
 in /etc/make.conf.
-.PP
 .SH "SEE ALSO"
-\fBpkg_add\fR(1),
-\fBpkg_create\fR(1),
-\fBpkg_delete\fR(1),
 \fBpkg_glob\fR(1),
 \fBportupgrade\fR(1),
 \fBportsdb\fR(1),
 \fBports_glob\fR(1),
 \fBpkgtools.conf\fR(5),
 \fBports\fR(7),
-\fBpkg-add\fR(8),
-\fBpkg-create\fR(8),
-\fBpkg-delete\fR(8),
+\fBpkg\-add\fR(8),
+\fBpkg\-create\fR(8),
+\fBpkg\-delete\fR(8),
 \fBportmaster\fR(8)
+\fBportsreinstall\-chroot\fR(8),
+\fBportsreinstall\-chroot\-mount\fR(8),
+\fBportsreinstall\-upgrade\fR(8),
 .SH COPYRIGHT
 This software is distributed under the 2-Clause BSD License.
 .PP
-(C)\ 2010\-2013\ Mamoru\ Sakaue,\ MwGhennndo,\ All\ Rights\ Reserved.
+(C)\ 2010\-2018\ Mamoru\ Sakaue,\ MwGhennndo,\ All\ Rights\ Reserved.
 .PP
 Email:\ sakaue.mamoru@samurai.mwghennn.net
 .PP