OSDN Git Service

[IMPROVED] Adapt to the specification change of pkg-create(8) that the default extens...
[portsreinstall/current.git] / bin / portsreinstall
index ac02883..6e0b22a 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh -e
 # ==================================================================================
 # portsreinstall main script
-# Copyright (C) 2010-2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2010-2021 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
 # This software is distributed under the 2-Clause BSD License.
 # ==================================================================================
 
@@ -45,6 +45,7 @@ ETCDIR=${MYPREFIX}/etc
 . ${LIBDIR}/libusage.sh
 
 . ${LIBDIR}/main/libcommand.sh
+. ${LIBDIR}/main/libmain.sh
 . ${LIBDIR}/main/liboptions.sh
 . ${LIBDIR}/main/libtemp.sh
 . ${LIBDIR}/main/libusage.sh
@@ -63,6 +64,8 @@ database_maintain_reset_execflag
 # ==================================================
 
 main_parse_options_arguments "$@"
+shift "${OPTIONS_SHIFT}"
+shift "${COMMAND_SHIFT}"
 
 # ========================================================
 # ================== SET UP OF PARAMETERS ==================
@@ -89,6 +92,8 @@ MYPORTORIGIN=`pkgsys_get_my_origin 2> /dev/null` || :
 main_collect_all_installed_packages
 
 # Preliminary inspection of tools which have to be up-to-date
+main_determine_all_target_ports_of_tools
+main_preliminary_inspection_of_initial_tools
 main_preliminary_inspection_of_tools
 
 # Upgrade of pkg(8) if new
@@ -112,9 +117,6 @@ main_reflect_conf_changes
 
 # ============= Database construction =============
 
-# Execute command operations which must be done before the database construction
-command_all_exec_before_build_database "$@"
-
 # Execute command operations of database construction
 command_all_exec_build_database "$@"