OSDN Git Service

[IMPROVED] Possible confusion by obsolete packages during inspection is made to be...
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Wed, 12 Sep 2018 14:52:01 +0000 (22:52 +0800)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Wed, 12 Sep 2018 14:52:01 +0000 (22:52 +0800)
 Changes to be committed:
modified:   lib/libcommand_do.sh
modified:   lib/libdatabase_build.sh
modified:   lib/libmain.sh
modified:   man/portsreinstall.8

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

index f2317f4..9652fba 100644 (file)
@@ -169,6 +169,10 @@ 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"
+               while read origin
+               do
+                       [ -d "${PORTSDIR}/$origin" ] || echo "$origin"
+               done < ${DBDIR}/stage.loop_list/ports_to_inspect > ${DBDIR}/obsoletes_to_escape_for_inspection
                message_echo
        }
        program_exec_and_record_completion DETERMINE_ALL_TARGET_PORTS
@@ -182,6 +186,7 @@ command_do_prepare_for_inspect_all_dependencies ()
        _program_exec_and_record_completion__operation ()
        {
                message_section_title "Preparing for inspection of all dependencies"
+               database_build_escape "${DBDIR}/escaped_obsoletes" < ${DBDIR}/obsoletes_to_escape_for_inspection
                cp /dev/null "${DBDIR}/done_required_ports_to_inspect"
                message_echo
        }
@@ -472,6 +477,20 @@ command_do_inspection_of_dependents ()
        program_exec_and_record_completion INSPECT_DEPENDENTS
 }
 
+# ============= Restore escaped obsolete packages for inspection =============
+command_do_restore_escaped_obsoletes ()
+{
+       local PROGRAM_DEPENDS
+       PROGRAM_DEPENDS='INSPECT_DEPENDENTS'
+       _program_exec_and_record_completion__operation ()
+       {
+               message_section_title "Restoring escaped obsolete packages for inspection"
+               database_build_restore < ${DBDIR}/escaped_obsoletes
+               message_echo
+       }
+       program_exec_and_record_completion RESTORE_ESCAPED_OBSOLETE_PACKAGES_FOR_INSPECTION
+}
+
 # ============= Remove duplicated lines in dependents lists =============
 command_do_remove_duplicated_lines_in_dependents_lists ()
 {
@@ -1085,7 +1104,7 @@ command_do_clean_up_of_reinstallation_status_for_preparation ()
 command_do_completion_of_building_the_temporary_database ()
 {
        local PROGRAM_DEPENDS
-       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'
+       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'
        _program_exec_and_record_completion__operation ()
        {
                message_section_title "The temporary database is completely built up"
index 6cdb5d9..11a3d81 100644 (file)
@@ -482,43 +482,62 @@ database_build_determine_flavored_origin ()
 database_build_escape_inspect_conflict ()
 {
        local origin dbpath
+       origin=$1
        dbpath=${DBDIR}/requires/$origin
        if [ -e "$dbpath/CONFLICT.conf" ]
        then
                message_echo "${DEPTH_INDEX}  ===> Escaping inspection conflict..."
-               pkgsys_eval_ports_glob `cat "$dbpath/CONFLICT.conf"` | while read origin_conflict
-               do
-                       pkg_conflict=`pkgsys_get_installed_pkg_from_origin "$origin_conflict"`
-                       [ -n "$pkg_conflict" ] || continue
-                       message_echo "${DEPTH_INDEX}  ===> Escaping $pkg_conflict..."
-                       pkgarc=`pkgsys_create_backup_pkg "$pkg_conflict" "${DBDIR}/backup_packages" 2> /dev/null` || \
-                               message_echo "${DEPTH_INDEX}  ===> (WARNING: Failed to back up)"
-                       pkg_delete_f "$pkg_conflict" > /dev/null 2>&1 || \
-                               message_echo "${DEPTH_INDEX}  ===> (WARNING: Failed to delete)"
-                       [ -n "$pkgarc" ] && printf '%s\t%s\n' "$pkg_conflict" "$pkgarc" >> $dbpath/CONFLICT_pkgarc.lst
-               done
+               pkgsys_eval_ports_glob `cat "$dbpath/CONFLICT.conf"` | database_build_escape "$dbpath/CONFLICT_pkgarc.lst"
        fi
 }
 
+# ============= Escape of conflicts =============
+# A list of conflict package origins are given by stdin.
+database_build_escape ()
+{
+       local backup_list origin_conflict pkg_conflict pkgarc
+       backup_list=$1
+       while read origin_conflict
+       do
+               pkg_conflict=`pkgsys_get_installed_pkg_from_origin "$origin_conflict"`
+               [ -n "$pkg_conflict" ] || continue
+               message_echo "${DEPTH_INDEX}  ===> Escaping $pkg_conflict..."
+               pkgarc=`pkgsys_create_backup_pkg "$pkg_conflict" "${DBDIR}/backup_packages" 2> /dev/null` || \
+                       message_echo "${DEPTH_INDEX}  ===> (WARNING: Failed to back up)"
+               pkg_delete_f "$pkg_conflict" > /dev/null 2>&1 || \
+                       message_echo "${DEPTH_INDEX}  ===> (WARNING: Failed to delete)"
+               [ -n "$pkgarc" ] && printf '%s\t%s\n' "$pkg_conflict" "$pkgarc" >> $backup_list
+       done
+}
+
 # ============= Restoration of escaped inspection conflict =============
 database_build_restore_inspect_conflict ()
 {
        local origin dbpath
+       origin=$1
        dbpath=${DBDIR}/requires/$origin
        if [ -e "$dbpath/CONFLICT.conf" ]
        then
                message_echo "${DEPTH_INDEX}  ===> Restoring inspection conflict..."
-               cat "$dbpath/CONFLICT_pkgarc.lst" 2> /dev/null | while read pkg_conflict pkgarc
-               do
-                       pkg_info_e "$pkg_conflict" && continue
-                       message_echo "${DEPTH_INDEX}  ===> Restoring $pkg_conflict..."
-                       pkg_add_f "$pkgarc" > /dev/null 2>&1 || \
-                               message_echo "${DEPTH_INDEX}  ===> (WARNING: Failed to restore $pkg_conflict)"
-               done
+               cat "$dbpath/CONFLICT_pkgarc.lst" 2> /dev/null | database_build_restore
                rm -f "$dbpath/CONFLICT_pkgarc.lst"
        fi
 }
 
+# ============= Restoration of escaped conflicts =============
+# The backup list is given by stdin.
+database_build_restore ()
+{
+       local pkg_conflict pkgarc
+       while read pkg_conflict pkgarc
+       do
+               pkg_info_e "$pkg_conflict" && continue
+               message_echo "${DEPTH_INDEX}  ===> Restoring $pkg_conflict..."
+               pkg_add_f "$pkgarc" > /dev/null 2>&1 || \
+                       message_echo "${DEPTH_INDEX}  ===> (WARNING: Failed to restore $pkg_conflict)"
+       done
+}
+
 # ============= Recursively inspect dependencies of a port and build a node database of the information =============
 database_build_inspect_dependencies ()
 {
index 1d6804b..8d113ef 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_20180912212038
+       MYVERSION=4.0.0+toward_4.1.0_20180912224956
        COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$'
 }
 
index f252444..c17a142 100644 (file)
@@ -1185,6 +1185,8 @@ Configuration file of \fBportupgrade\fR(1).
 .PP
 [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.
 .PP
+[IMPROVED] Possible confusion by obsolete packages during inspection is made to be avoided by temporary escape.
+.PP
 [BUG FIX] Adding packages sometimes failed due to lack of required packages.
 .PP
 [BUG FIX] \fBreset\fR command discarded the information of the initially installed packages.