2 # ==============================================================================
3 # portsreinstall library script
4 # - Interface of libraries for operations of commands as well as check of command line arguments -
5 # Copyright (C) 2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
6 # This software is distributed under the 2-Clause BSD License.
7 # ==============================================================================
9 # ============= Variables =============
22 # ============= Check the necessity of opening notice =============
23 command_all_chk_need_opening_notice ()
28 # ============= Check the number of following command line arguments (in case glob arguments are needed) =============
29 _command_parse_args__chk_glob_args ()
33 [ $nargs -gt 0 ] && return
34 message_echo "ERROR: No port glob is specified." >&2
38 # ============= Check the number of following command line arguments (in case without arguments) =============
39 _command_parse_args__chk_no_arg ()
41 local nargs term_redundant_argument
43 [ $nargs -eq 0 ] && return
44 term_redundant_argument='A redundant argument is'
45 [ $nargs -gt 1 ] && term_redundant_argument='Redundant arguments are'
46 message_echo "ERROR: $term_redundant_argument specified." >&2
50 # ============= Execute command operations before getting the temporary database ready =============
51 command_all_exec_before_db_creation ()
55 # ============= Check and parse command line arguments =============
56 command_all_parse_args ()
60 # ============= Notify that option settings are reset =============
61 command_exec_without_pkgtools__notify_reset_options ()
63 message_echo "NOTE: Option settings are ignored (because of no effect) and reset."
66 # ============= Execute command operations which do not need package tools =============
67 command_all_exec_without_pkgtools ()
72 # ============= Notify that option settings are ignored because of no effect =============
73 _command_exec_irrespective_of_saved_options__notify_ignored_options ()
75 [ $opt_no_opening_message = yes ] && return
76 message_echo "NOTE: Option settings are ignored because they have no effect on this command."
79 # ============= Execute command operations which are irrespective of option settings =============
80 command_all_exec_irrespective_of_saved_options ()
84 # ============= Execute command operations which should be done without upgrade of tools =============
85 command_all_exec_before_tools_upgrade ()
89 # ============= Execute command operations which must be done before the database construction =============
90 command_all_exec_before_build_database ()
94 # ============= Execute command operations of database construction =============
95 command_all_exec_build_database ()
99 # ============= Execute command operations which must be done before the main process =============
100 command_all_exec_before_main ()
104 # ============= Execute command operations as the main process =============
105 command_all_exec_main ()