OSDN Git Service

Fixed a bug that obsolete or moved ports were not inspected. For this purpose, the...
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Thu, 13 Sep 2018 15:33:07 +0000 (00:33 +0900)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Thu, 13 Sep 2018 15:33:07 +0000 (00:33 +0900)
 Changes to be committed:
modified:   bin/portsreinstall
modified:   lib/libcommand_do.sh
modified:   lib/libdatabase_build.sh
modified:   lib/libmain.sh

bin/portsreinstall
lib/libcommand_do.sh
lib/libdatabase_build.sh
lib/libmain.sh

index 3e2a05b..b12c025 100755 (executable)
@@ -92,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
index 6ff92ba..649cf2c 100644 (file)
@@ -169,6 +169,7 @@ command_do_determine_all_target_ports ()
                        cat "${DBDIR}/stage.loop_list/target_requirements.specified" || :
                        cat "${DBDIR}/targets_specified_so_far" || :
                }  2> /dev/null | sort -u > "${DBDIR}/stage.loop_list/ports_to_inspect"
+               cp "${DBDIR}/stage.loop_list/ports_to_inspect" "${DBDIR}/stage.loop_list/ports_to_inspect_initial"
                while read origin
                do
                        [ -d "${PORTSDIR}/$origin" ] || echo "$origin"
@@ -178,11 +179,35 @@ command_do_determine_all_target_ports ()
        program_exec_and_record_completion DETERMINE_ALL_TARGET_PORTS
 }
 
+# ============= Inspection of all initial dependencies =============
+command_do_inspection_of_all_initial_dependencies ()
+{
+       local PROGRAM_DEPENDS
+       PROGRAM_DEPENDS='DETERMINE_ALL_TARGET_PORTS'
+       _program_exec_restartable_loop_operation__routine ()
+       {
+               local origin
+               origin=$1
+               database_build_setup_initial_node "$origin"
+       }
+       _program_exec_and_record_completion__operation ()
+       {
+               local DEPTH_INDEX 
+               message_section_title "Inspecting initial dependencies of the all installed packages"
+               [ $opt_only_target_scope = no -a -n "$opt_target_itself$opt_target_dependents$opt_target_requirements" ] && \
+                       message_echo "INFO: Ports which seem irrelevant to the targets are also inspected in order to get complete information."
+               program_exec_restartable_loop_operation ports_to_inspect_initial
+               database_build_post_inspect_initial_dependencies
+               message_echo
+       }
+       program_exec_and_record_completion INSPECT_ALL_INITIAL_DEPENDENCIES
+}
+
 # ============= Prepare for inspecting all dependencies =============
 command_do_prepare_for_inspect_all_dependencies ()
 {
        local PROGRAM_DEPENDS
-       PROGRAM_DEPENDS='PARSE_CONF  DETERMINE_ALL_TARGET_PORTS'
+       PROGRAM_DEPENDS='PARSE_CONF  INSPECT_ALL_INITIAL_DEPENDENCIES'
        _program_exec_and_record_completion__operation ()
        {
                message_section_title "Preparing for inspection of all dependencies"
@@ -1275,6 +1300,9 @@ command_do_prepare ()
        # Determine all target ports
        command_do_determine_all_target_ports
        
+       # Inspection of all initial dependencies
+       command_do_inspection_of_all_initial_dependencies
+       
        # Loop considering cases that port options are changed after inspection
        while true
        do
index 11a3d81..bef02a7 100644 (file)
@@ -552,9 +552,8 @@ database_build_inspect_dependencies ()
                message_echo "${DEPTH_INDEX} $origin_orig"
                database_build_convert_and_register_origin_if_obsolete__reset_origins_old
                origin_id=`echo "$origin_orig" | tr / :`
-               database_build_setup_initial_node "$origin_orig"
                # Replacement specified by the configuration file, knobs and port options
-               tmp_config=${TMPDIR}/database_build_inspect_dependencies:confi
+               tmp_config=${TMPDIR}/database_build_inspect_dependencies:config
                database_build_setup_replace_node "$origin_orig" "$tmp_config.before" "$tmp_config.after"
                if [ -e "${DBDIR}/replace/$origin_orig/origin" ]
                then
@@ -1149,6 +1148,13 @@ database_build_patch_reconf ()
        database_build_clear_db_dirs "$origin"
 }
 
+# ============= Post-processes after finishing to inspect initial dependencies =============
+database_build_post_inspect_initial_dependencies ()
+{
+       find "${DBDIR}/initial" -depth 2 -type d \
+               | sed -E 's|.*/([^/]+/[^/]+)$|\1|' > ${DBDIR}/inspected_ports.initial
+}
+
 # ============= Post-processes after finishing to inspect dependencies =============
 database_build_post_inspect_dependencies ()
 {
@@ -1157,8 +1163,6 @@ database_build_post_inspect_dependencies ()
        touch "${DBDIR}/obsolete_ports" "${DBDIR}/inspected_ports.update"
        find "${DBDIR}/requires" -depth 2 -type d \
                | sed -E 's|.*/([^/]+/[^/]+)$|\1|' > ${DBDIR}/inspected_ports
-       find "${DBDIR}/initial" -depth 2 -type d \
-               | sed -E 's|.*/([^/]+/[^/]+)$|\1|' > ${DBDIR}/inspected_ports.initial
        sort -u "${DBDIR}/inspected_ports" "${DBDIR}/inspected_ports.initial" > ${DBDIR}/inspected_ports.all
        {
                cat "${DBDIR}/conf/HOLD:PORTS.parsed" || :
index d8175e1..6bbbcde 100644 (file)
@@ -12,7 +12,7 @@ main_set_version ()
        MYVERSION=4.1.0
        COMPATIBLE_VERSIONS='^(4\.[1]\.[0-9])$'
        # Template for development versions
-       MYVERSION=4.0.0+toward_4.1.0_20180913004127
+       MYVERSION=4.0.0+toward_4.1.0_20180914003252
        COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$'
 }
 
@@ -344,12 +344,54 @@ main_collect_all_installed_packages ()
        program_exec_and_record_completion COLLECT_ALL_INSTALLED_PACKAGES
 }
 
+# ============= Determine all target ports of tools which have to be up-to-date =============
+main_determine_all_target_ports_of_tools ()
+{
+       local PROGRAM_DEPENDS
+       PROGRAM_DEPENDS=
+       _program_exec_and_record_completion__operation ()
+       {
+               message_section_title "Determining all target ports of tools which have to be up-to-date"
+               {
+                       [ "$PKGSYS_USE_PKGNG" = yes ] && pkgsys_portsmgmt_pkg
+                       pkgsys_is_dialog4ports_used && pkgsys_portsmgmt_dialog4ports
+                       [ -n "$MYPORTORIGIN" ] && echo "$MYPORTORIGIN"
+               } 2> /dev/null > ${DBDIR}/stage.loop_list/tools_to_inspect
+               cp "${DBDIR}/stage.loop_list/tools_to_inspect" "${DBDIR}/stage.loop_list/tools_to_inspect_initial"
+               message_echo
+       }
+       program_exec_and_record_completion DETERMINE_ALL_TARGET_PORTS_OF_TOOLS
+}
+
+# ============= Preliminary inspection of initially installed tools which have to be up-to-date =============
+# (No need depend on PARSE_CONF because INSPECT_ALL_DEPENDENCIES will take the task.)
+main_preliminary_inspection_of_initial_tools ()
+{
+       local PROGRAM_DEPENDS
+       PROGRAM_DEPENDS='DETERMINE_ALL_TARGET_PORTS_OF_TOOLS'
+       _program_exec_restartable_loop_operation__routine ()
+       {
+               local origin
+               origin=$1
+               database_build_setup_initial_node "$origin"
+       }
+       _program_exec_and_record_completion__operation ()
+       {
+               local DEPTH_INDEX
+               message_section_title "Preliminary inspection of initially installed tools which have to be up-to-date"
+               program_exec_restartable_loop_operation tools_to_inspect_initial
+               database_build_post_inspect_initial_dependencies
+               message_echo
+       }
+       program_exec_and_record_completion PRELIMINARY_INSPECTION_OF_INITIAL_TOOLS
+}
+
 # ============= Preliminary inspection of tools which have to be up-to-date =============
 # (No need depend on PARSE_CONF because INSPECT_ALL_DEPENDENCIES will take the task.)
 main_preliminary_inspection_of_tools ()
 {
        local PROGRAM_DEPENDS
-       PROGRAM_DEPENDS=
+       PROGRAM_DEPENDS='PRELIMINARY_INSPECTION_OF_INITIAL_TOOLS'
        _program_exec_restartable_loop_operation__routine ()
        {
                local origin
@@ -360,11 +402,6 @@ main_preliminary_inspection_of_tools ()
        {
                local DEPTH_INDEX
                message_section_title "Preliminary inspection of tools which have to be up-to-date"
-               {
-                       [ "$PKGSYS_USE_PKGNG" = yes ] && pkgsys_portsmgmt_pkg
-                       pkgsys_is_dialog4ports_used && pkgsys_portsmgmt_dialog4ports
-                       [ -n "$MYPORTORIGIN" ] && echo "$MYPORTORIGIN"
-               } 2> /dev/null > ${DBDIR}/stage.loop_list/tools_to_inspect
                cp /dev/null "${DBDIR}/done_required_ports_to_inspect"
                DEPTH_INDEX='--'
                program_exec_restartable_loop_operation tools_to_inspect