OSDN Git Service

[BUG FIX] Adding packages sometimes failed due to lack of required packages.
[portsreinstall/current.git] / lib / libmain.sh
index 572d264..fba76fc 100644 (file)
@@ -9,11 +9,11 @@
 # ============= Define the software version =============
 main_set_version ()
 {
-       MYVERSION=4.0.1
-       COMPATIBLE_VERSIONS='^(4\.[0]\.[0-1])$'
+       MYVERSION=4.1.0
+       COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9])$'
        # Template for development versions
-       MYVERSION=4.0.0+toward_4.0.1_20180715175555
-       COMPATIBLE_VERSIONS='^(4\.[0]\.[0-1]]|4\.[0]\.[0]+(|\+toward_4\.[0]\.[1]+_[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 =============
@@ -265,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
 }
@@ -378,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
@@ -405,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
@@ -437,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"