local enable_static_programs="yes"
local enable_static_libraries="yes"
local enable_includes="yes"
- local print_line_first="yes"
- local print_line_last="yes"
if [[ $# -gt 0 ]] ; then
t=$#
verbosity="debug"
verbose="+D"
verbose_common="-v"
- elif [[ ${p} == "+F" || ${p} == "++line_first_no" ]] ; then
- print_line_first="no"
- elif [[ ${p} == "+L" || ${p} == "++line_last_no" ]] ; then
- print_line_last="no"
elif [[ ${p} == "+v" || ${p} == "++version" ]] ; then
echo ${version}
return 0
p=
fi
- if [[ ${verbosity} == "quiet" ]] ; then
- print_line_first="no"
- print_line_last="no"
- fi
-
install_handle_colors
if [[ ${do_help} == "yes" ]] ; then
if [[ ${operation_failure} == "fail-unsupported" ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The operation ${c_notice}${operation}${c_error} was not recognized.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ! -d ${path_build} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The build path ${c_notice}${path_build}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && ${destination_prefix} != "" && ! -d ${destination_prefix} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination prefix ${c_notice}${destination_prefix}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} != "" && ! -d ${work} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The work directory ${c_notice}${work}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && -e ${destination_programs} && ! -d ${destination_programs} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination bindir ${c_notice}${destination_programs}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && -e ${destination_programs_static} && ! -d ${destination_programs_static} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination (${c_notice}static${c_error}) bindir ${c_notice}${destination_programs_static}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && -e ${destination_programs_shared} && ! -d ${destination_programs_shared} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination (${c_notice}shared${c_error}) bindir ${c_notice}${destination_programs_shared}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && -e ${destination_includes} && ! -d ${destination_includes} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination incluedir ${c_notice}${destination_includes}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && -e ${destination_libraries_static} && ! -d ${destination_libraries_static} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination (${c_notice}static${c_error}) libdir ${c_notice}${destination_libraries_static}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && -e ${destination_libraries_shared} && ! -d ${destination_libraries_shared} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination (${c_notice}shared${c_error}) libdir ${c_notice}${destination_libraries_shared}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
install_perform_install
- if [[ ${verbosity} != "quiet" ]] ; then
- if [[ ${failure} -eq 1 || ${verbosity} != "error" ]] ; then
- install_print_last
- fi
- fi
-
install_cleanup
if [[ ${failure} -eq 1 ]] ; then
install_help() {
- install_print_first
-
echo -e "${c_title}${public_name}${c_reset}"
echo -e " ${c_notice}Version ${version}${c_reset}"
echo
echo -e "${c_highlight}${system_name}${c_reset} ${c_notice}[${c_reset} options ${c_notice}]${c_reset}"
echo
echo -e "${c_highlight}Options:${c_reset}"
- echo -e " -${c_important}h${c_reset}, --${c_important}help${c_reset} Print this help message."
- echo -e " +${c_important}C${c_reset}, ++${c_important}copyright${c_reset} Print the copyright."
- echo -e " +${c_important}d${c_reset}, ++${c_important}dark${c_reset} Output using colors that show up better on dark backgrounds."
- echo -e " +${c_important}l${c_reset}, ++${c_important}light${c_reset} Output using colors that show up better on light backgrounds."
- echo -e " +${c_important}n${c_reset}, ++${c_important}no_color${c_reset} Do not print using color."
- echo -e " +${c_important}Q${c_reset}, ++${c_important}quiet${c_reset} Decrease verbosity, silencing most print.to."
- echo -e " +${c_important}E${c_reset}, ++${c_important}error${c_reset} Decrease verbosity, using only error print.to."
- echo -e " +${c_important}N${c_reset}, ++${c_important}normal${c_reset} Set verbosity to normal."
- echo -e " +${c_important}V${c_reset}, ++${c_important}verbose${c_reset} Increase verbosity beyond normal print.to."
- echo -e " +${c_important}D${c_reset}, ++${c_important}debug${c_reset} Enable debugging, significantly increasing verbosity beyond normal print.to."
- echo -e " +${c_important}v${c_reset}, ++${c_important}version${c_reset} Print only the version number."
- echo -e " +${c_important}F${c_reset}, ++${c_important}line_first_no${c_reset} Disable printing of first line."
- echo -e " +${c_important}L${c_reset}, ++${c_important}line_last_no${c_reset} Disable printing of last line."
+ echo -e " -${c_important}h${c_reset}, --${c_important}help${c_reset} Print this help message."
+ echo -e " +${c_important}C${c_reset}, ++${c_important}copyright${c_reset} Print the copyright."
+ echo -e " +${c_important}d${c_reset}, ++${c_important}dark${c_reset} Output using colors that show up better on dark backgrounds."
+ echo -e " +${c_important}l${c_reset}, ++${c_important}light${c_reset} Output using colors that show up better on light backgrounds."
+ echo -e " +${c_important}n${c_reset}, ++${c_important}no_color${c_reset} Do not print using color."
+ echo -e " +${c_important}Q${c_reset}, ++${c_important}quiet${c_reset} Decrease verbosity, silencing most print.to."
+ echo -e " +${c_important}E${c_reset}, ++${c_important}error${c_reset} Decrease verbosity, using only error print.to."
+ echo -e " +${c_important}N${c_reset}, ++${c_important}normal${c_reset} Set verbosity to normal."
+ echo -e " +${c_important}V${c_reset}, ++${c_important}verbose${c_reset} Increase verbosity beyond normal print.to."
+ echo -e " +${c_important}D${c_reset}, ++${c_important}debug${c_reset} Enable debugging, significantly increasing verbosity beyond normal print.to."
+ echo -e " +${c_important}v${c_reset}, ++${c_important}version${c_reset} Print only the version number."
echo
echo -e "${c_highlight}Install Options:${c_reset}"
echo -e " -${c_important}b${c_reset}, --${c_important}build${c_reset} Custom build directory."
echo -e " --${c_important}libraries-shared${c_reset} Custom destination for shared libraries."
echo -e " --${c_important}programs-static${c_reset} Custom destination for static programs."
echo -e " --${c_important}programs-shared${c_reset} Custom destination for shared programs."
-
- install_print_last
}
install_copyright() {
- install_print_first
-
- echo "Copyright © 2007-2023 Kevin Day."
+ echo "Copyright © 2007-2024 Kevin Day."
echo
echo "Source code license lgpl-2.1-or-later."
- echo "Standard and specification license open-standard-license-1.0."
+ echo "Standard and specification license open-standard-license-1.0-or-later."
echo "Documentation license cc-by-sa-4.0."
-
- install_print_last
}
install_perform_install() {
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_prefix}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_programs}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_programs_shared}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_programs_static}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_libraries}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_libraries_shared}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_libraries_static}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_includes}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_documentation}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_settings}${c_error}.${c_reset}"
fi
if [[ ${file} != "" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing Includes to: ${c_reset}${c_notice}${destination_includes}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to copy include files from ${c_notice}${path_build}${path_includes}${c_error} to ${c_notice}${destination_includes}${c_error}.${c_reset}"
fi
if [[ ${file} != "" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing (${c_notice}static${c_highlight}) Libraries to: ${c_reset}${c_notice}${destination_libraries_static}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to copy (${c_notice}static${c_error}) library files from ${c_notice}${path_build}${path_libraries}${path_static}${c_error} to ${c_notice}${destination_libraries_static}${c_error}.${c_reset}"
fi
if [[ ${file} != "" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing (${c_notice}shared${c_highlight}) Libraries to: ${c_reset}${c_notice}${destination_libraries_shared}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to copy (${c_notice}shared${c_error}) library files from ${c_notice}${path_build}${path_libraries}${path_shared}${c_error} to ${c_notice}${destination_libraries_shared}${c_error}.${c_reset}"
fi
if [[ ${file} != "" && ${enable_static_programs} == "yes" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing (${c_notice}static${c_highlight}) Programs to: ${c_reset}${c_notice}${destination_programs_static}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: failed to copy (${c_notice}static${c_error}) program files from ${c_notice}${path_build}${path_programs}${path_static}${c_error} to ${c_notice}${destination_programs_static}${c_error}.${c_reset}"
fi
if [[ ${file} != "" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing (${c_notice}shared${c_highlight}) Programs to: ${c_reset}${c_notice}${destination_programs_shared}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: failed to copy (${c_notice}shared${c_error}) program files from ${c_notice}${path_build}${path_programs}${path_shared}${c_error} to ${c_notice}${destination_programs_shared}${c_error}.${c_reset}"
fi
if [[ ${file} != "" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing Settings to: ${c_reset}${c_notice}${destination_settings}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: failed to copy settings files from ${c_notice}${path_build}${path_settings}${c_error} to ${c_notice}${destination_settings}${c_error}.${c_reset}"
fi
if [[ ${file} != "" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing Documentation to: ${c_reset}${c_notice}${destination_documentation}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: failed to copy documentation files from ${c_notice}${path_build}${path_documentation}${c_error} to ${c_notice}${destination_documentation}${c_error}.${c_reset}"
fi
return 0
}
-install_print_first() {
-
- if [[ ${print_line_first} == "yes" ]] ; then
- echo
-
- print_line_first=
- fi
-}
-
-install_print_first_or_always() {
-
- if [[ ${print_line_first} == "yes" ]] ; then
- echo
-
- print_line_first=
- elif [[ ${print_line_first} == "no" ]] ; then
- print_line_first=
- else
- echo
- fi
-}
-
-install_print_last() {
-
- if [[ ${print_line_last} == "yes" ]] ; then
- echo
- fi
-}
-
install_cleanup() {
unset install_copyright
unset install_handle_colors
unset install_help
unset install_perform_install
- unset install_print_first
- unset install_print_first_or_always
- unset install_print_last
unset install_cleanup
}
main->setting.state.step_small = controller_allocation_small_d;
- if (main->program.parameters.array[f_console_standard_parameter_line_first_no_e].result & f_console_result_found_e) {
- main->setting.flag &= ~controller_main_flag_print_first_e;
- }
- else {
- main->setting.flag |= controller_main_flag_print_first_e;
- }
-
- if (main->program.parameters.array[f_console_standard_parameter_line_last_no_e].result & f_console_result_found_e) {
- main->setting.flag &= ~controller_main_flag_print_last_e;
- }
- else {
- main->setting.flag |= controller_main_flag_print_last_e;
- }
-
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & controller_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
controller_main_print_error(&main->program.error, macro_controller_f(f_console_parameter_process));
return;
main->setting.state.status = fll_program_parameter_process_context_standard(F_true, &main->program);
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & controller_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
controller_main_print_error(&main->program.error, macro_controller_f(fll_program_parameter_process_context_standard));
return;
main->setting.state.status = fll_program_parameter_process_verbosity_standard(F_true, &main->program);
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & controller_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
controller_main_print_error(&main->program.error, macro_controller_f(fll_program_parameter_process_verbosity_standard));
return;
if (main->program.parameters.array[controller_parameter_settings_e].result & codes[index]) {
main->setting.state.status = F_status_set_error(F_parameter);
- if ((main->setting.flag & controller_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, strings[index]);
return;
main->setting.state.status = f_string_dynamic_append(main->program.parameters.remaining.used ? args[main->program.parameters.remaining.array[0]] : controller_default_s, &program->name_entry);
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & controller_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
controller_main_print_error(&main->program.error, macro_controller_f(fll_program_parameter_process_verbosity_standard));
return;
main->setting.state.status = f_path_current(F_false, &program->path_current);
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & controller_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
controller_main_print_error(&main->program.error, macro_controller_f(f_path_current));
return;
}
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & controller_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
if (main->program.parameters.array[controller_parameter_settings_e].locations.used) {
controller_main_print_error_file(&main->program.error, macro_controller_f(controller_path_canonical_relative), args[index], f_file_operation_verify_s, fll_error_file_type_path_e);
}
}
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & controller_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
controller_main_print_error(&main->program.error, macro_controller_f(f_string_dynamic_append));
return;
controller_path_canonical_relative(main, program->path_current, args[index], &program->path_cgroup);
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & controller_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
controller_main_print_error_file(&main->program.error, macro_controller_f(controller_path_canonical_relative), args[index], f_file_operation_verify_s, fll_error_file_type_path_e);
return;
main->setting.state.status = f_string_append_assure(F_path_separator_s, 1, &program->path_cgroup);
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & controller_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
controller_main_print_error(&main->program.error, macro_controller_f(f_string_append_assure));
return;