• R/O
  • HTTP
  • SSH
  • HTTPS

current: Commit

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


Commit MetaInfo

Revisione33d5f98fe1cc27e7cc0c14407619e14dd35e989 (tree)
Time2018-09-12 23:52:01
AuthorMamoru Sakaue / MwGhennndo <glmwghennndo@user...>
CommiterMamoru Sakaue / MwGhennndo

Log Message

[IMPROVED] Possible confusion by obsolete packages during inspection is made to be avoided by temporary escape.

Changes to be committed:

modified: lib/libcommand_do.sh
modified: lib/libdatabase_build.sh
modified: lib/libmain.sh
modified: man/portsreinstall.8

Change Summary

Incremental Difference

--- a/lib/libcommand_do.sh
+++ b/lib/libcommand_do.sh
@@ -169,6 +169,10 @@ 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+ while read origin
173+ do
174+ [ -d "${PORTSDIR}/$origin" ] || echo "$origin"
175+ done < ${DBDIR}/stage.loop_list/ports_to_inspect > ${DBDIR}/obsoletes_to_escape_for_inspection
172176 message_echo
173177 }
174178 program_exec_and_record_completion DETERMINE_ALL_TARGET_PORTS
@@ -182,6 +186,7 @@ command_do_prepare_for_inspect_all_dependencies ()
182186 _program_exec_and_record_completion__operation ()
183187 {
184188 message_section_title "Preparing for inspection of all dependencies"
189+ database_build_escape "${DBDIR}/escaped_obsoletes" < ${DBDIR}/obsoletes_to_escape_for_inspection
185190 cp /dev/null "${DBDIR}/done_required_ports_to_inspect"
186191 message_echo
187192 }
@@ -472,6 +477,20 @@ command_do_inspection_of_dependents ()
472477 program_exec_and_record_completion INSPECT_DEPENDENTS
473478 }
474479
480+# ============= Restore escaped obsolete packages for inspection =============
481+command_do_restore_escaped_obsoletes ()
482+{
483+ local PROGRAM_DEPENDS
484+ PROGRAM_DEPENDS='INSPECT_DEPENDENTS'
485+ _program_exec_and_record_completion__operation ()
486+ {
487+ message_section_title "Restoring escaped obsolete packages for inspection"
488+ database_build_restore < ${DBDIR}/escaped_obsoletes
489+ message_echo
490+ }
491+ program_exec_and_record_completion RESTORE_ESCAPED_OBSOLETE_PACKAGES_FOR_INSPECTION
492+}
493+
475494 # ============= Remove duplicated lines in dependents lists =============
476495 command_do_remove_duplicated_lines_in_dependents_lists ()
477496 {
@@ -1085,7 +1104,7 @@ command_do_clean_up_of_reinstallation_status_for_preparation ()
10851104 command_do_completion_of_building_the_temporary_database ()
10861105 {
10871106 local PROGRAM_DEPENDS
1088- PROGRAM_DEPENDS='REDO_INIT SETUP_REINST_TODO CLEANUP_REINST_STATUS PARSE_CONF INSPECT_ALL_DEPENDENCIES NECESSARY_UPDATES:direct NECESSARY_UPDATES:full PARSE_TARGET_ATTR_INFO MAKE_DEPENDENTS_LISTS_UNIQUE MAKE_IGNORED_DEPENDENTS_LISTS_UNIQUE COLLECT_LEAF_PORTS_TO_DELETE'
1107+ PROGRAM_DEPENDS='REDO_INIT SETUP_REINST_TODO CLEANUP_REINST_STATUS PARSE_CONF INSPECT_ALL_DEPENDENCIES RESTORE_ESCAPED_OBSOLETE_PACKAGES_FOR_INSPECTION NECESSARY_UPDATES:direct NECESSARY_UPDATES:full PARSE_TARGET_ATTR_INFO MAKE_DEPENDENTS_LISTS_UNIQUE MAKE_IGNORED_DEPENDENTS_LISTS_UNIQUE COLLECT_LEAF_PORTS_TO_DELETE'
10891108 _program_exec_and_record_completion__operation ()
10901109 {
10911110 message_section_title "The temporary database is completely built up"
--- a/lib/libdatabase_build.sh
+++ b/lib/libdatabase_build.sh
@@ -482,43 +482,62 @@ database_build_determine_flavored_origin ()
482482 database_build_escape_inspect_conflict ()
483483 {
484484 local origin dbpath
485+ origin=$1
485486 dbpath=${DBDIR}/requires/$origin
486487 if [ -e "$dbpath/CONFLICT.conf" ]
487488 then
488489 message_echo "${DEPTH_INDEX} ===> Escaping inspection conflict..."
489- pkgsys_eval_ports_glob `cat "$dbpath/CONFLICT.conf"` | while read origin_conflict
490- do
491- pkg_conflict=`pkgsys_get_installed_pkg_from_origin "$origin_conflict"`
492- [ -n "$pkg_conflict" ] || continue
493- message_echo "${DEPTH_INDEX} ===> Escaping $pkg_conflict..."
494- pkgarc=`pkgsys_create_backup_pkg "$pkg_conflict" "${DBDIR}/backup_packages" 2> /dev/null` || \
495- message_echo "${DEPTH_INDEX} ===> (WARNING: Failed to back up)"
496- pkg_delete_f "$pkg_conflict" > /dev/null 2>&1 || \
497- message_echo "${DEPTH_INDEX} ===> (WARNING: Failed to delete)"
498- [ -n "$pkgarc" ] && printf '%s\t%s\n' "$pkg_conflict" "$pkgarc" >> $dbpath/CONFLICT_pkgarc.lst
499- done
490+ pkgsys_eval_ports_glob `cat "$dbpath/CONFLICT.conf"` | database_build_escape "$dbpath/CONFLICT_pkgarc.lst"
500491 fi
501492 }
502493
494+# ============= Escape of conflicts =============
495+# A list of conflict package origins are given by stdin.
496+database_build_escape ()
497+{
498+ local backup_list origin_conflict pkg_conflict pkgarc
499+ backup_list=$1
500+ while read origin_conflict
501+ do
502+ pkg_conflict=`pkgsys_get_installed_pkg_from_origin "$origin_conflict"`
503+ [ -n "$pkg_conflict" ] || continue
504+ message_echo "${DEPTH_INDEX} ===> Escaping $pkg_conflict..."
505+ pkgarc=`pkgsys_create_backup_pkg "$pkg_conflict" "${DBDIR}/backup_packages" 2> /dev/null` || \
506+ message_echo "${DEPTH_INDEX} ===> (WARNING: Failed to back up)"
507+ pkg_delete_f "$pkg_conflict" > /dev/null 2>&1 || \
508+ message_echo "${DEPTH_INDEX} ===> (WARNING: Failed to delete)"
509+ [ -n "$pkgarc" ] && printf '%s\t%s\n' "$pkg_conflict" "$pkgarc" >> $backup_list
510+ done
511+}
512+
503513 # ============= Restoration of escaped inspection conflict =============
504514 database_build_restore_inspect_conflict ()
505515 {
506516 local origin dbpath
517+ origin=$1
507518 dbpath=${DBDIR}/requires/$origin
508519 if [ -e "$dbpath/CONFLICT.conf" ]
509520 then
510521 message_echo "${DEPTH_INDEX} ===> Restoring inspection conflict..."
511- cat "$dbpath/CONFLICT_pkgarc.lst" 2> /dev/null | while read pkg_conflict pkgarc
512- do
513- pkg_info_e "$pkg_conflict" && continue
514- message_echo "${DEPTH_INDEX} ===> Restoring $pkg_conflict..."
515- pkg_add_f "$pkgarc" > /dev/null 2>&1 || \
516- message_echo "${DEPTH_INDEX} ===> (WARNING: Failed to restore $pkg_conflict)"
517- done
522+ cat "$dbpath/CONFLICT_pkgarc.lst" 2> /dev/null | database_build_restore
518523 rm -f "$dbpath/CONFLICT_pkgarc.lst"
519524 fi
520525 }
521526
527+# ============= Restoration of escaped conflicts =============
528+# The backup list is given by stdin.
529+database_build_restore ()
530+{
531+ local pkg_conflict pkgarc
532+ while read pkg_conflict pkgarc
533+ do
534+ pkg_info_e "$pkg_conflict" && continue
535+ message_echo "${DEPTH_INDEX} ===> Restoring $pkg_conflict..."
536+ pkg_add_f "$pkgarc" > /dev/null 2>&1 || \
537+ message_echo "${DEPTH_INDEX} ===> (WARNING: Failed to restore $pkg_conflict)"
538+ done
539+}
540+
522541 # ============= Recursively inspect dependencies of a port and build a node database of the information =============
523542 database_build_inspect_dependencies ()
524543 {
--- 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_20180912212038
15+ MYVERSION=4.0.0+toward_4.1.0_20180912224956
1616 COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$'
1717 }
1818
--- a/man/portsreinstall.8
+++ b/man/portsreinstall.8
@@ -1185,6 +1185,8 @@ Configuration file of \fBportupgrade\fR(1).
11851185 .PP
11861186 [IMPROVED] \fBportsreinstall\-chroot\fR(8) now allows unprivileged operation of \fBmount\fR, \fBunmount\fR and \fBenter\fR if the file systems of the builder chroot environment are ready.
11871187 .PP
1188+[IMPROVED] Possible confusion by obsolete packages during inspection is made to be avoided by temporary escape.
1189+.PP
11881190 [BUG FIX] Adding packages sometimes failed due to lack of required packages.
11891191 .PP
11901192 [BUG FIX] \fBreset\fR command discarded the information of the initially installed packages.
Show on old repository browser