• R/O
  • HTTP
  • SSH
  • HTTPS

current: Commit

This is for active development.
New funtionalities are to be added actively.


Commit MetaInfo

Revisioneef49b58a1d722e712e56987cda9de0875549c1a (tree)
Time2018-09-14 00:33:07
AuthorMamoru Sakaue / MwGhennndo <glmwghennndo@user...>
CommiterMamoru Sakaue / MwGhennndo

Log Message

Fixed a bug that obsolete or moved ports were not inspected. For this purpose, the inspection of ports is split to ones for initially installed packages and finally installed ports.

Changes to be committed:

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

Change Summary

Incremental Difference

--- a/bin/portsreinstall
+++ b/bin/portsreinstall
@@ -92,6 +92,8 @@ MYPORTORIGIN=`pkgsys_get_my_origin 2> /dev/null` || :
9292 main_collect_all_installed_packages
9393
9494 # Preliminary inspection of tools which have to be up-to-date
95+main_determine_all_target_ports_of_tools
96+main_preliminary_inspection_of_initial_tools
9597 main_preliminary_inspection_of_tools
9698
9799 # Upgrade of pkg(8) if new
--- a/lib/libcommand_do.sh
+++ b/lib/libcommand_do.sh
@@ -169,6 +169,7 @@ command_do_determine_all_target_ports ()
169169 cat "${DBDIR}/stage.loop_list/target_requirements.specified" || :
170170 cat "${DBDIR}/targets_specified_so_far" || :
171171 } 2> /dev/null | sort -u > "${DBDIR}/stage.loop_list/ports_to_inspect"
172+ cp "${DBDIR}/stage.loop_list/ports_to_inspect" "${DBDIR}/stage.loop_list/ports_to_inspect_initial"
172173 while read origin
173174 do
174175 [ -d "${PORTSDIR}/$origin" ] || echo "$origin"
@@ -178,11 +179,35 @@ command_do_determine_all_target_ports ()
178179 program_exec_and_record_completion DETERMINE_ALL_TARGET_PORTS
179180 }
180181
182+# ============= Inspection of all initial dependencies =============
183+command_do_inspection_of_all_initial_dependencies ()
184+{
185+ local PROGRAM_DEPENDS
186+ PROGRAM_DEPENDS='DETERMINE_ALL_TARGET_PORTS'
187+ _program_exec_restartable_loop_operation__routine ()
188+ {
189+ local origin
190+ origin=$1
191+ database_build_setup_initial_node "$origin"
192+ }
193+ _program_exec_and_record_completion__operation ()
194+ {
195+ local DEPTH_INDEX
196+ message_section_title "Inspecting initial dependencies of the all installed packages"
197+ [ $opt_only_target_scope = no -a -n "$opt_target_itself$opt_target_dependents$opt_target_requirements" ] && \
198+ message_echo "INFO: Ports which seem irrelevant to the targets are also inspected in order to get complete information."
199+ program_exec_restartable_loop_operation ports_to_inspect_initial
200+ database_build_post_inspect_initial_dependencies
201+ message_echo
202+ }
203+ program_exec_and_record_completion INSPECT_ALL_INITIAL_DEPENDENCIES
204+}
205+
181206 # ============= Prepare for inspecting all dependencies =============
182207 command_do_prepare_for_inspect_all_dependencies ()
183208 {
184209 local PROGRAM_DEPENDS
185- PROGRAM_DEPENDS='PARSE_CONF DETERMINE_ALL_TARGET_PORTS'
210+ PROGRAM_DEPENDS='PARSE_CONF INSPECT_ALL_INITIAL_DEPENDENCIES'
186211 _program_exec_and_record_completion__operation ()
187212 {
188213 message_section_title "Preparing for inspection of all dependencies"
@@ -1275,6 +1300,9 @@ command_do_prepare ()
12751300 # Determine all target ports
12761301 command_do_determine_all_target_ports
12771302
1303+ # Inspection of all initial dependencies
1304+ command_do_inspection_of_all_initial_dependencies
1305+
12781306 # Loop considering cases that port options are changed after inspection
12791307 while true
12801308 do
--- a/lib/libdatabase_build.sh
+++ b/lib/libdatabase_build.sh
@@ -552,9 +552,8 @@ database_build_inspect_dependencies ()
552552 message_echo "${DEPTH_INDEX} $origin_orig"
553553 database_build_convert_and_register_origin_if_obsolete__reset_origins_old
554554 origin_id=`echo "$origin_orig" | tr / :`
555- database_build_setup_initial_node "$origin_orig"
556555 # Replacement specified by the configuration file, knobs and port options
557- tmp_config=${TMPDIR}/database_build_inspect_dependencies:confi
556+ tmp_config=${TMPDIR}/database_build_inspect_dependencies:config
558557 database_build_setup_replace_node "$origin_orig" "$tmp_config.before" "$tmp_config.after"
559558 if [ -e "${DBDIR}/replace/$origin_orig/origin" ]
560559 then
@@ -1149,6 +1148,13 @@ database_build_patch_reconf ()
11491148 database_build_clear_db_dirs "$origin"
11501149 }
11511150
1151+# ============= Post-processes after finishing to inspect initial dependencies =============
1152+database_build_post_inspect_initial_dependencies ()
1153+{
1154+ find "${DBDIR}/initial" -depth 2 -type d \
1155+ | sed -E 's|.*/([^/]+/[^/]+)$|\1|' > ${DBDIR}/inspected_ports.initial
1156+}
1157+
11521158 # ============= Post-processes after finishing to inspect dependencies =============
11531159 database_build_post_inspect_dependencies ()
11541160 {
@@ -1157,8 +1163,6 @@ database_build_post_inspect_dependencies ()
11571163 touch "${DBDIR}/obsolete_ports" "${DBDIR}/inspected_ports.update"
11581164 find "${DBDIR}/requires" -depth 2 -type d \
11591165 | sed -E 's|.*/([^/]+/[^/]+)$|\1|' > ${DBDIR}/inspected_ports
1160- find "${DBDIR}/initial" -depth 2 -type d \
1161- | sed -E 's|.*/([^/]+/[^/]+)$|\1|' > ${DBDIR}/inspected_ports.initial
11621166 sort -u "${DBDIR}/inspected_ports" "${DBDIR}/inspected_ports.initial" > ${DBDIR}/inspected_ports.all
11631167 {
11641168 cat "${DBDIR}/conf/HOLD:PORTS.parsed" || :
--- a/lib/libmain.sh
+++ b/lib/libmain.sh
@@ -12,7 +12,7 @@ main_set_version ()
1212 MYVERSION=4.1.0
1313 COMPATIBLE_VERSIONS='^(4\.[1]\.[0-9])$'
1414 # Template for development versions
15- MYVERSION=4.0.0+toward_4.1.0_20180913004127
15+ MYVERSION=4.0.0+toward_4.1.0_20180914003252
1616 COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$'
1717 }
1818
@@ -344,12 +344,54 @@ main_collect_all_installed_packages ()
344344 program_exec_and_record_completion COLLECT_ALL_INSTALLED_PACKAGES
345345 }
346346
347+# ============= Determine all target ports of tools which have to be up-to-date =============
348+main_determine_all_target_ports_of_tools ()
349+{
350+ local PROGRAM_DEPENDS
351+ PROGRAM_DEPENDS=
352+ _program_exec_and_record_completion__operation ()
353+ {
354+ message_section_title "Determining all target ports of tools which have to be up-to-date"
355+ {
356+ [ "$PKGSYS_USE_PKGNG" = yes ] && pkgsys_portsmgmt_pkg
357+ pkgsys_is_dialog4ports_used && pkgsys_portsmgmt_dialog4ports
358+ [ -n "$MYPORTORIGIN" ] && echo "$MYPORTORIGIN"
359+ } 2> /dev/null > ${DBDIR}/stage.loop_list/tools_to_inspect
360+ cp "${DBDIR}/stage.loop_list/tools_to_inspect" "${DBDIR}/stage.loop_list/tools_to_inspect_initial"
361+ message_echo
362+ }
363+ program_exec_and_record_completion DETERMINE_ALL_TARGET_PORTS_OF_TOOLS
364+}
365+
366+# ============= Preliminary inspection of initially installed tools which have to be up-to-date =============
367+# (No need depend on PARSE_CONF because INSPECT_ALL_DEPENDENCIES will take the task.)
368+main_preliminary_inspection_of_initial_tools ()
369+{
370+ local PROGRAM_DEPENDS
371+ PROGRAM_DEPENDS='DETERMINE_ALL_TARGET_PORTS_OF_TOOLS'
372+ _program_exec_restartable_loop_operation__routine ()
373+ {
374+ local origin
375+ origin=$1
376+ database_build_setup_initial_node "$origin"
377+ }
378+ _program_exec_and_record_completion__operation ()
379+ {
380+ local DEPTH_INDEX
381+ message_section_title "Preliminary inspection of initially installed tools which have to be up-to-date"
382+ program_exec_restartable_loop_operation tools_to_inspect_initial
383+ database_build_post_inspect_initial_dependencies
384+ message_echo
385+ }
386+ program_exec_and_record_completion PRELIMINARY_INSPECTION_OF_INITIAL_TOOLS
387+}
388+
347389 # ============= Preliminary inspection of tools which have to be up-to-date =============
348390 # (No need depend on PARSE_CONF because INSPECT_ALL_DEPENDENCIES will take the task.)
349391 main_preliminary_inspection_of_tools ()
350392 {
351393 local PROGRAM_DEPENDS
352- PROGRAM_DEPENDS=
394+ PROGRAM_DEPENDS='PRELIMINARY_INSPECTION_OF_INITIAL_TOOLS'
353395 _program_exec_restartable_loop_operation__routine ()
354396 {
355397 local origin
@@ -360,11 +402,6 @@ main_preliminary_inspection_of_tools ()
360402 {
361403 local DEPTH_INDEX
362404 message_section_title "Preliminary inspection of tools which have to be up-to-date"
363- {
364- [ "$PKGSYS_USE_PKGNG" = yes ] && pkgsys_portsmgmt_pkg
365- pkgsys_is_dialog4ports_used && pkgsys_portsmgmt_dialog4ports
366- [ -n "$MYPORTORIGIN" ] && echo "$MYPORTORIGIN"
367- } 2> /dev/null > ${DBDIR}/stage.loop_list/tools_to_inspect
368405 cp /dev/null "${DBDIR}/done_required_ports_to_inspect"
369406 DEPTH_INDEX='--'
370407 program_exec_restartable_loop_operation tools_to_inspect
Show on old repository browser