OSDN Git Service

[BUG FIX] Adding packages sometimes failed due to lack of required packages.
[portsreinstall/current.git] / lib / libmain.sh
index 05f3851..fba76fc 100644 (file)
@@ -9,11 +9,11 @@
 # ============= Define the software version =============
 main_set_version ()
 {
-       MYVERSION=4.0.0
-       COMPATIBLE_VERSIONS='^(4\.[0]\.[0])$'
+       MYVERSION=4.1.0
+       COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9])$'
        # Template for development versions
-       MYVERSION=3.3.2+toward_4.0.0_20180629133501
-       COMPATIBLE_VERSIONS='^(4\.[0]\.[0]|3\.[1-3]\.[0-9]+(|\+toward_4\.[0]\.[0]+_[0-9]+))$'
+       MYVERSION=4.0.0+toward_4.1.0_20180811185627
+       COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$'
 }
 
 # ============= Parse options, arguments and control parameters =============
@@ -239,6 +239,10 @@ main_parse_conf ()
                conf_build_replacement_patterns_from_REPLACE
                # CONFLICT_*
                conf_parse_vars_for_each_port_glob_with_bound_val CONFLICT TARGET DEF
+               # BUILDCONFLICT_*
+               conf_parse_vars_for_each_port_glob_with_bound_val BUILDCONFLICT TARGET DEF
+               # INSTCONFLICT_*
+               conf_parse_vars_for_each_port_glob_with_bound_val INSTCONFLICT TARGET DEF
                # MARG_*
                conf_parse_vars_for_each_port_glob_with_bound_val MARG TARGET DEF
                # MENV_*
@@ -261,43 +265,43 @@ main_setup_parameters ()
        main_define_common_termination_messages
        temp_reset_termination_messages_common
        main_set_termination_messages_special
-
+       
        # ============= Opening title =============
-
+       
        message_credit
        command_all_chk_need_opening_notice && message_opening_notice
        message_echo
-
+       
        # ============= Execute command operations which do not need package tools =============
-
+       
        command_all_exec_without_pkgtools "$@"
        misc_is_superuser_privilege && database_maintain_mark_use
        # ============= Definition of environment dependent functions =============
-
+       
        pkgsys_def_pkgtools
-
+       
        # ============= Option settings =============
-
+       
        # Execute command operations which are not affected by saved option settings
        command_all_exec_irrespective_of_saved_options "$@"
-
+       
        # Load, renew and save option values
        main_option_settings
-
+       
        # Show option values
        message_show_option_settings
-
+       
        # ============= Configurations =============
-
+       
        # Save the previous configuration if exists
        main_save_prev_conf
-
+       
        # Get complete configuration variable definitions by importing pkgtools.conf(5) if available
        main_get_complete_conf
-
+       
        # Parse the configuration
        main_parse_conf
-
+       
        # Load the saved configuration
        main_load_conf
 }
@@ -374,12 +378,14 @@ main_upgrade_pkg8_if_new ()
                PROGRAM_DEPENDS='PRELIMINARY_INSPECTION_OF_TOOLS'
                _program_exec_and_record_completion__operation ()
                {
-                       local _MSG_CURRENT_STAGE_general
+                       local _MSG_CURRENT_STAGE_general origin
                        _MSG_CURRENT_STAGE_general="pkg(8) upgrade"
+                       origin=`pkgsys_portsmgmt_pkg`
                        temp_set_msg_current_stage "${_MSG_CURRENT_STAGE_general}"
-                       message_section_title "Upgrade of `pkgsys_portsmgmt_pkg` if new"
+                       message_section_title "Upgrade of $origin if new"
                        touch "${DBDIR}/target_all"
-                       reinstall_exec `pkgsys_portsmgmt_pkg`
+                       cp "${DBDIR}/requires/$origin/requirements.all.direct.src" "${DBDIR}/requires/$origin/requirements.all.full"
+                       reinstall_exec "$origin"
                        reinstall_restore_conflicts
                        rm -f "${DBDIR}/target_all"
                        temp_set_msg_current_stage
@@ -401,12 +407,14 @@ main_upgrade_dialog4ports1_if_new ()
                PROGRAM_DEPENDS='PRELIMINARY_INSPECTION_OF_TOOLS'
                _program_exec_and_record_completion__operation ()
                {
-                       local _MSG_CURRENT_STAGE_general
+                       local _MSG_CURRENT_STAGE_general origin
                        _MSG_CURRENT_STAGE_general="dialog4ports(1) upgrade"
+                       origin=`pkgsys_portsmgmt_dialog4ports`
                        temp_set_msg_current_stage "${_MSG_CURRENT_STAGE_general}"
-                       message_section_title "Upgrade of `pkgsys_portsmgmt_dialog4ports` if new"
+                       message_section_title "Upgrade of $origin if new"
                        touch "${DBDIR}/target_all"
-                       reinstall_exec `pkgsys_portsmgmt_dialog4ports`
+                       cp "${DBDIR}/requires/$origin/requirements.all.direct.src" "${DBDIR}/requires/$origin/requirements.all.full"
+                       reinstall_exec "$origin"
                        reinstall_restore_conflicts
                        rm -f "${DBDIR}/target_all"
                        temp_set_msg_current_stage
@@ -433,6 +441,7 @@ main_self_upgrade ()
                        temp_set_msg_current_stage "${_MSG_CURRENT_STAGE_general}"
                        message_section_title "Upgrade of this utility if new"
                        touch "${DBDIR}/target_all"
+                       cp "${DBDIR}/requires/$MYPORTORIGIN/requirements.all.direct.src" "${DBDIR}/requires/$MYPORTORIGIN/requirements.all.full"
                        reinstall_exec "$MYPORTORIGIN"
                        reinstall_restore_conflicts
                        rm -f "${DBDIR}/target_all"
@@ -521,9 +530,10 @@ main_reflect_conf_changes ()
                then
                        sort -u "$tmpfile_updated_ports" | while read origin
                        do
+                               message_echo "Reset for $origin"
                                database_build_patch_reconf "$origin"
                        done
-                       program_deregister_stage_complete INSPECT_ALL_DEPENDENCIES
+                       program_deregister_stage_complete PREPARE_FOR_INSPECT_ALL_DEPENDENCIES
                        program_deregister_stage_complete ALL_COMPLETE
                fi
                message_echo