From 05e440a2eac351c873340d02b6ea4c496b98ea8f Mon Sep 17 00:00:00 2001 From: Kevin Day <Kevin@kevux.org> Date: Wed, 22 May 2024 22:18:56 -0500 Subject: [PATCH] Cleanup: Remove first/last backported printing code. The first/last code was backported in the past to make the scripts more forward-compatible. I have decided to remove the first/last printing feature after significant testing and review. The 0.7 development and later no longer has the first/last and so the backported code is no longer needed. --- build/scripts/bootstrap-example.sh | 43 +++-- build/scripts/bootstrap.sh | 127 --------------- build/scripts/generate_ctags.sh | 57 ------- build/scripts/install.sh | 148 +---------------- build/scripts/package.sh | 319 ++----------------------------------- build/scripts/test.sh | 188 +--------------------- 6 files changed, 50 insertions(+), 832 deletions(-) diff --git a/build/scripts/bootstrap-example.sh b/build/scripts/bootstrap-example.sh index 2398fc9..e7c4f86 100644 --- a/build/scripts/bootstrap-example.sh +++ b/build/scripts/bootstrap-example.sh @@ -68,7 +68,6 @@ build_mode_extra_value_1= build_mode_extra_param_2= build_mode_extra_value_2= shell_command=bash -suppress_first="" exclude_programs= grab_next= skip= @@ -150,11 +149,11 @@ if [[ ${1} == "individual" ]] ; then cd package/individual/${i}-${version}/ && - ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} && - ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m individual -m individual_thread ${mode_thread_param} ${mode_thread_value} ${mode_compiler_param} ${mode_compiler_value} && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${shared} ${static} -w ${path_work} -m individual -m individual_thread ${mode_thread_param} ${mode_thread_value} ${mode_compiler_param} ${mode_compiler_value} && - ${shell_command} ./install.sh ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} && + ${shell_command} ./install.sh ${verbose} ${color} ${shared} ${static} -w ${path_work} && cd ${path_original} || break done @@ -166,31 +165,31 @@ if [[ ${1} == "level" ]] ; then cd package/level/fll-level_0-${version}/ && - ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} && - ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m level ${mode_thread_param} ${mode_thread_value} ${mode_compiler_param} ${mode_compiler_value} && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${shared} ${static} -w ${path_work} -m level ${mode_thread_param} ${mode_thread_value} ${mode_compiler_param} ${mode_compiler_value} && - ${shell_command} ./install.sh ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} && + ${shell_command} ./install.sh ${verbose} ${color} ${shared} ${static} -w ${path_work} && cd ${path_original} && cd package/level/fll-level_1-${version}/ && - ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} && - ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m level ${mode_thread_param} ${mode_thread_value} ${mode_compiler_param} ${mode_compiler_value} && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${shared} ${static} -w ${path_work} -m level ${mode_thread_param} ${mode_thread_value} ${mode_compiler_param} ${mode_compiler_value} && - ${shell_command} ./install.sh ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} && + ${shell_command} ./install.sh ${verbose} ${color} ${shared} ${static} -w ${path_work} && cd ${path_original} && cd package/level/fll-level_2-${version}/ && - ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} && - ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m level ${mode_thread_param} ${mode_thread_value} ${mode_compiler_param} ${mode_compiler_value} && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${shared} ${static} -w ${path_work} -m level ${mode_thread_param} ${mode_thread_value} ${mode_compiler_param} ${mode_compiler_value} && - ${shell_command} ./install.sh ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} + ${shell_command} ./install.sh ${verbose} ${color} ${shared} ${static} -w ${path_work} fi if [[ ${1} == "monolithic" ]] ; then @@ -198,11 +197,11 @@ if [[ ${1} == "monolithic" ]] ; then cd package/monolithic/fll-${version}/ && - ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} && - ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m monolithic ${mode_thread_param} ${mode_thread_value} ${mode_compiler_param} ${mode_compiler_value} && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${shared} ${static} -w ${path_work} -m monolithic ${mode_thread_param} ${mode_thread_value} ${mode_compiler_param} ${mode_compiler_value} && - ${shell_command} ./install.sh ${verbose} ${color} ${shared} ${suppress_first} ${static} -w ${path_work} + ${shell_command} ./install.sh ${verbose} ${color} ${shared} ${static} -w ${path_work} fi # The following in an example on building individual projects. @@ -254,11 +253,11 @@ if [[ ${mode_part} != "" ]] ; then cd package/${mode_path}/${mode_part}-${version}/ && - ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} && - ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m ${build_mode} ${build_mode_extra_param_1} ${build_mode_extra_value_1} ${build_mode_extra_param_2} ${build_mode_extra_value_2} ${mode_compiler_param} ${mode_compiler_value} && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${shared} ${static} -w ${path_work} -m ${build_mode} ${build_mode_extra_param_1} ${build_mode_extra_value_1} ${build_mode_extra_param_2} ${build_mode_extra_value_2} ${mode_compiler_param} ${mode_compiler_value} && - ${shell_command} ./install.sh ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} + ${shell_command} ./install.sh ${verbose} ${color} ${shared} ${static} -w ${path_work} # The following in an example on building all FLL program projects using the project bootstrapped from above. elif [[ ${1} == "programs-individual" || ${1} == "programs-level" || ${1} == "programs-monolithic" ]] ; then @@ -314,11 +313,11 @@ elif [[ ${1} == "programs-individual" || ${1} == "programs-level" || ${1} == "pr cd ${path_original}package/program/${i} && - ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} && - ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m ${build_mode} ${build_mode_extra_param_1} ${build_mode_extra_value_1} ${build_mode_extra_param_2} ${build_mode_extra_value_2} ${mode_compiler_param} ${mode_compiler_value} && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${shared} ${static} -w ${path_work} -m ${build_mode} ${build_mode_extra_param_1} ${build_mode_extra_value_1} ${build_mode_extra_param_2} ${build_mode_extra_value_2} ${mode_compiler_param} ${mode_compiler_value} && - ${shell_command} ./install.sh ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} || + ${shell_command} ./install.sh ${verbose} ${color} ${shared} ${static} -w ${path_work} || break done diff --git a/build/scripts/bootstrap.sh b/build/scripts/bootstrap.sh index 807c908..73328e9 100644 --- a/build/scripts/bootstrap.sh +++ b/build/scripts/bootstrap.sh @@ -61,8 +61,6 @@ bootstrap_main() { local path_sources=sources/ local path_language=c/ local path_work= - local print_line_first="yes" - local print_line_last="yes" local project_built= local project_built_shared= local project_built_static= @@ -193,11 +191,6 @@ bootstrap_main() { p= fi - if [[ ${verbosity} == "quiet" ]] ; then - print_line_first="no" - print_line_last="no" - fi - # If the settings_name has a directory separator, then assume it is a path to the settings file. if [[ $(echo ${settings_name} | grep -s -o '/') == "" ]] ; then settings_file="${path_data}build/${settings_name}" @@ -236,11 +229,7 @@ bootstrap_main() { for mode in ${modes} ; do if [[ $(echo "${mode}" | grep -s -o "[^_[:alnum:]+-]") != "" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The mode ${c_notice}${mode}${c_error} includes invalid characters, only alphanumeric, underscore, minus, and plus are allowed.${c_reset}" - - bootstrap_print_last fi bootstrap_cleanup @@ -276,11 +265,7 @@ bootstrap_main() { if [[ ${modes_available} == "" ]] ; then if [[ ${modes} != "" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The mode(s) ${c_notice}${modes}${c_error} are not a valid modes, there are no available modes.${c_error}${c_reset}" - - bootstrap_print_last fi bootstrap_cleanup @@ -305,11 +290,7 @@ bootstrap_main() { if [[ ${i} -eq 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The mode(s) ${c_notice}${modes}${c_error} are not valid modes, they must be one of: ${c_notice}${modes_available}${c_error}.${c_reset}" - - bootstrap_print_last fi bootstrap_cleanup @@ -321,11 +302,7 @@ bootstrap_main() { bootstrap_id "build_name" if [[ ${variables[${key}]} == "" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The required setting '${c_notice}build_name${c_error}' is not specified in the build settings file '${c_notice}${settings_file}${c_error}'.${c_reset}" - - bootstrap_print_last fi bootstrap_cleanup @@ -336,11 +313,7 @@ bootstrap_main() { bootstrap_id "version_major" if [[ ${variables[${key}]} == "" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The required setting '${c_notice}version_major${c_error}' is not specified in the build settings file '${c_notice}${settings_file}${c_error}'.${c_reset}" - - bootstrap_print_last fi bootstrap_cleanup @@ -351,11 +324,7 @@ bootstrap_main() { bootstrap_id "version_minor" if [[ ${variables[${key}]} == "" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The required setting '${c_notice}version_minor${c_error}' is not specified in the build settings file '${c_notice}${settings_file}${c_error}'.${c_reset}" - - bootstrap_print_last fi bootstrap_cleanup @@ -366,11 +335,7 @@ bootstrap_main() { bootstrap_id "version_micro" if [[ ${variables[${key}]} == "" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The required setting '${c_notice}version_micro${c_error}' is not specified in the build settings file '${c_notice}${settings_file}${c_error}'.${c_reset}" - - bootstrap_print_last fi bootstrap_cleanup @@ -380,11 +345,7 @@ bootstrap_main() { if [[ ${path_data} == "" || ! -d ${path_data} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The data directory ${c_notice}${path_data}${c_error} is not a valid directory.${c_reset}" - - bootstrap_print_last fi bootstrap_cleanup @@ -394,11 +355,7 @@ bootstrap_main() { if [[ ${path_sources} == "" || ! -d ${path_sources} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The sources directory ${c_notice}${path_sources}${c_error} is not a valid directory.${c_reset}" - - bootstrap_print_last fi bootstrap_cleanup @@ -408,11 +365,7 @@ bootstrap_main() { if [[ ${path_work} != "" && ! -d ${path_work} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The work directory ${c_notice}${path_work}${c_error} is not a valid directory.${c_reset}" - - bootstrap_print_last fi bootstrap_cleanup @@ -440,11 +393,7 @@ bootstrap_main() { if [[ ${operation_failure} == "fail-multiple" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Only one operation may be specified at a time.${c_reset}" - - bootstrap_print_last fi bootstrap_cleanup @@ -452,8 +401,6 @@ bootstrap_main() { return 1 elif [[ ${operation} == "build" ]] ; then if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - bootstrap_print_first - echo -e "${c_highlight}Building:${c_reset} ${c_notice}${project_label}${c_highlight} with modes: ${c_notice}${modes}${c_highlight}.${c_reset}" fi @@ -476,16 +423,12 @@ bootstrap_main() { fi elif [[ ${operation} == "clean" ]] ; then if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - bootstrap_print_first - echo -e "${c_highlight}Cleaning Project:${c_reset} ${c_notice}${project_label}${c_highlight}.${c_reset}" fi bootstrap_operation_clean elif [[ ${operation} == "" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: No operation was given.${c_reset}" fi @@ -494,11 +437,7 @@ bootstrap_main() { return 1 else if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The operation ${c_notice}${operation}${c_error} was not recognized.${c_reset}" - - bootstrap_print_last fi bootstrap_cleanup @@ -506,12 +445,6 @@ bootstrap_main() { return 1 fi - if [[ ${verbosity} != "quiet" ]] ; then - if [[ ${failure} -eq 1 || ${verbosity} != "error" ]] ; then - bootstrap_print_last - fi - fi - bootstrap_cleanup return 0 @@ -541,8 +474,6 @@ bootstrap_handle_colors() { bootstrap_help() { - bootstrap_print_first - echo -e "${c_title}${public_name}${c_reset}" echo -e " ${c_notice}Version ${version}${c_reset}" echo @@ -581,21 +512,15 @@ bootstrap_help() { echo -e " --${c_important}disable-shared${c_reset} Forcibly do not build shared files." echo -e " --${c_important}enable-static${c_reset} Forcibly do build static files." echo -e " --${c_important}disable-static${c_reset} Forcibly do not build static files." - - bootstrap_print_last } bootstrap_copyright() { - bootstrap_print_first - 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-or-later." echo "Documentation license cc-by-sa-4.0." - - bootstrap_print_last } bootstrap_id() { @@ -852,16 +777,12 @@ bootstrap_load_settings() { if [[ ! -d ${path_data}build/ ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: No build settings directory '${c_notice}${path_data}build/${c_error}' could not be found or is not a valid directory.${c_reset}" fi let failure=1 elif [[ ! -f ${settings_file} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: No settings file ${c_notice}${settings_file}${c_error} could not be found or is not a valid file.${c_reset}" fi @@ -1714,8 +1635,6 @@ bootstrap_operation_build() { if [[ ${failure} -eq 1 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Failed to build.${c_reset}" fi @@ -2815,8 +2734,6 @@ bootstrap_operation_build_validate_build() { if [[ ${build_compiler} == "" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Cannot Build, no '${c_notice}build_compiler${c_error}' specified, such as '${c_notice}gcc${c_error}'.${c_reset}" fi @@ -2825,8 +2742,6 @@ bootstrap_operation_build_validate_build() { if [[ ${build_indexer} == "" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Cannot Build, no '${c_notice}build_indexer${c_error}' specified, such as '${c_notice}ar${c_error}'.${c_reset}" fi @@ -2844,8 +2759,6 @@ bootstrap_operation_build_validate_paths() { if [[ ${path_sources} == "" || ! -d ${path_sources} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The sources directory ${c_notice}${path_sources}${c_error} is not a valid directory.${c_reset}" fi @@ -2854,8 +2767,6 @@ bootstrap_operation_build_validate_paths() { if [[ ${failure} -eq 0 && ${path_sources_object} != "" && ! -d ${path_sources_object} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: The sources object directory ${c_notice}${path_sources_object}${c_error} is not a valid directory.${c_reset}" fi @@ -2881,8 +2792,6 @@ bootstrap_operation_build_validate_shared_static() { if [[ ${build_shared} != "yes" && ${build_static} != "yes" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Cannot Build, either build_shared or build_static must be set to 'yes'.${c_reset}" fi @@ -2891,8 +2800,6 @@ bootstrap_operation_build_validate_shared_static() { if [[ ${search_shared} != "yes" && ${search_static} != "yes" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Cannot Build, either search_shared or search_static must be set to 'yes'.${c_reset}" fi @@ -2911,8 +2818,6 @@ bootstrap_operation_build_validate_sources() { for i in ${sources_script} ; do if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_script path provided: '${i}'.${c_reset}" fi @@ -2923,8 +2828,6 @@ bootstrap_operation_build_validate_sources() { for i in ${sources_headers} ; do if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_headers path provided: '${i}'.${c_reset}" fi @@ -2935,8 +2838,6 @@ bootstrap_operation_build_validate_sources() { for i in ${sources_library} ; do if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_library path provided: '${i}'.${c_reset}" fi @@ -2947,8 +2848,6 @@ bootstrap_operation_build_validate_sources() { for i in ${sources_library_object} ; do if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_library_object path provided: '${i}'.${c_reset}" fi @@ -2959,8 +2858,6 @@ bootstrap_operation_build_validate_sources() { for i in ${sources_program_object} ; do if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_program_object path provided: '${i}'.${c_reset}" fi @@ -2971,8 +2868,6 @@ bootstrap_operation_build_validate_sources() { for i in ${sources_program} ; do if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_program path provided: '${i}'.${c_reset}" fi @@ -2983,8 +2878,6 @@ bootstrap_operation_build_validate_sources() { for i in ${sources_documentation} ; do if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_documentation path provided: '${i}'.${c_reset}" fi @@ -2995,8 +2888,6 @@ bootstrap_operation_build_validate_sources() { for i in ${sources_setting} ; do if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - bootstrap_print_first - echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_setting path provided: '${i}'.${c_reset}" fi @@ -3092,22 +2983,6 @@ bootstrap_operation_clean() { fi } -bootstrap_print_first() { - - if [[ ${print_line_first} == "yes" ]] ; then - echo - - print_line_first= - fi -} - -bootstrap_print_last() { - - if [[ ${print_line_last} == "yes" ]] ; then - echo - fi -} - bootstrap_cleanup() { unset bootstrap_copyright @@ -3138,8 +3013,6 @@ bootstrap_cleanup() { unset bootstrap_operation_build_validate_shared_static unset bootstrap_operation_build_validate_sources unset bootstrap_operation_clean - unset bootstrap_print_first - unset bootstrap_print_last unset bootstrap_cleanup } diff --git a/build/scripts/generate_ctags.sh b/build/scripts/generate_ctags.sh index 0436fe7..dea025f 100644 --- a/build/scripts/generate_ctags.sh +++ b/build/scripts/generate_ctags.sh @@ -42,8 +42,6 @@ main() { local failure=0 local file= local name= - local print_line_first="yes" - local print_line_last="yes" local source="./" local verbosity=normal local verbose= @@ -119,11 +117,6 @@ main() { p= fi - if [[ ${verbosity} == "quiet" ]] ; then - print_line_first="no" - print_line_last="no" - fi - generate_ctags_handle_colors if [[ ${do_help} == "yes" ]] ; then @@ -142,15 +135,11 @@ main() { if [[ $(echo "$name" | grep -s -o "/") != "" || ${name} == "" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - generate_ctags_print_first - if [[ ${name} == "" ]] ; then echo -e "${c_error}ERROR: No ${c_notice}name${c_error} parameter has been provided or is empty.${c_reset}" else echo -e "${c_error}ERROR: The ${c_notice}name${c_error} parameter value '${c_notice}${name}${c_error}' must not have a slash.${c_reset}" fi - - generate_ctags_print_last fi generate_ctags_cleanup @@ -160,15 +149,11 @@ main() { if [[ ${destination} == "" || ! -d ${destination} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - generate_ctags_print_first - if [[ ${destination} == "" ]] ; then echo -e "${c_error}ERROR: The ${c_notice}destination${c_error} parameter is empty.${c_reset}" else echo -e "${c_error}ERROR: The ${c_notice}destination${c_error} parameter value '${c_notice}${destination}${c_error}' must be a directory.${c_reset}" fi - - generate_ctags_print_last fi generate_ctags_cleanup @@ -178,15 +163,11 @@ main() { if [[ ${source} == "" || ! -d ${source} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - generate_ctags_print_first - if [[ ${source} == "" ]] ; then echo -e "${c_error}ERROR: The ${c_notice}source${c_error} parameter is empty.${c_reset}" else echo -e "${c_error}ERROR: The ${c_notice}source${c_error} parameter value '${c_notice}${source}${c_error}' must be a directory.${c_reset}" fi - - generate_ctags_print_last fi generate_ctags_cleanup @@ -205,11 +186,7 @@ main() { if [[ $? -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - generate_ctags_print_first - echo -e "${c_error}ERROR: The ${c_notice}ctags${c_error} process failed.${c_reset}" - - generate_ctags_print_last fi generate_ctags_cleanup @@ -227,11 +204,7 @@ main() { if [[ $? -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - generate_ctags_print_first - echo -e "${c_error}ERROR: Failed to strip the full path from the ${c_notice}${file}${c_error} file.${c_reset}" - - generate_ctags_print_last fi generate_ctags_cleanup @@ -242,11 +215,7 @@ main() { fi if [[ ${verbosity} != "quiet" ]] ; then - generate_ctags_print_first - echo -e "${c_highlight}SUCCESS: The file ${c_notice}${file}${c_highlight} has been generated.${c_reset}" - - generate_ctags_print_last fi generate_ctags_cleanup @@ -254,22 +223,6 @@ main() { return 0 } -generate_ctags_print_first() { - - if [[ ${print_line_first} == "yes" ]] ; then - echo - - print_line_first= - fi -} - -generate_ctags_print_last() { - - if [[ ${print_line_last} == "yes" ]] ; then - echo - fi -} - generate_ctags_handle_colors() { if [[ ${do_color} == "light" ]] ; then @@ -294,8 +247,6 @@ generate_ctags_handle_colors() { generate_ctags_help() { - generate_ctags_print_first - echo -e "${c_title}${public_name}${c_reset}" echo -e " ${c_notice}Version ${version}${c_reset}" echo @@ -319,21 +270,15 @@ generate_ctags_help() { echo -e " -${c_important}s${c_reset}, --${c_important}source${c_reset} The source directory containing the header files for generating the ctags from." echo echo -e "The ${c_notice}name${c_reset} represents the name of the file, without the extension." - - generate_ctags_print_last } generate_ctags_copyright() { - generate_ctags_print_first - 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-or-later." echo "Documentation license cc-by-sa-4.0." - - generate_ctags_print_last } generate_ctags_cleanup() { @@ -342,8 +287,6 @@ generate_ctags_cleanup() { unset generate_ctags_main unset generate_ctags_handle_colors unset generate_ctags_help - unset generate_ctags_print_first - unset generate_ctags_print_last unset generate_ctags_cleanup } diff --git a/build/scripts/install.sh b/build/scripts/install.sh index 327a443..d51f2dc 100644 --- a/build/scripts/install.sh +++ b/build/scripts/install.sh @@ -81,8 +81,6 @@ install_main() { 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=$# @@ -223,11 +221,6 @@ install_main() { p= fi - if [[ ${verbosity} == "quiet" ]] ; then - print_line_first="no" - print_line_last="no" - fi - install_handle_colors if [[ ${do_help} == "yes" ]] ; then @@ -246,11 +239,7 @@ install_main() { 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 @@ -260,11 +249,7 @@ install_main() { 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 @@ -274,11 +259,7 @@ install_main() { 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 @@ -342,11 +323,7 @@ install_main() { 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 @@ -356,11 +333,7 @@ install_main() { 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 @@ -370,11 +343,7 @@ install_main() { 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 @@ -384,11 +353,7 @@ install_main() { 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 @@ -398,11 +363,7 @@ install_main() { 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 @@ -412,11 +373,7 @@ install_main() { 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 @@ -426,11 +383,7 @@ install_main() { 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 @@ -440,12 +393,6 @@ install_main() { 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 @@ -479,8 +426,6 @@ install_handle_colors() { install_help() { - install_print_first - echo -e "${c_title}${public_name}${c_reset}" echo -e " ${c_notice}Version ${version}${c_reset}" echo @@ -528,21 +473,15 @@ install_help() { 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-2024 Kevin Day." echo echo "Source code license lgpl-2.1-or-later." 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() { @@ -582,8 +521,6 @@ 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 @@ -597,8 +534,6 @@ 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_programs}${c_error}.${c_reset}" fi @@ -611,8 +546,6 @@ 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_programs_shared}${c_error}.${c_reset}" fi @@ -625,8 +558,6 @@ 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_programs_static}${c_error}.${c_reset}" fi @@ -641,8 +572,6 @@ 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_libraries}${c_error}.${c_reset}" fi @@ -655,8 +584,6 @@ install_perform_install() { 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 @@ -669,8 +596,6 @@ install_perform_install() { 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 @@ -685,8 +610,6 @@ install_perform_install() { 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 @@ -701,8 +624,6 @@ install_perform_install() { 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 @@ -717,8 +638,6 @@ install_perform_install() { 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 @@ -741,8 +660,7 @@ install_perform_install() { 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 @@ -750,8 +668,6 @@ install_perform_install() { 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 @@ -775,8 +691,7 @@ install_perform_install() { 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 @@ -784,8 +699,6 @@ install_perform_install() { 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 @@ -808,8 +721,7 @@ install_perform_install() { 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 @@ -817,8 +729,6 @@ install_perform_install() { 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 @@ -843,8 +753,7 @@ install_perform_install() { 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 @@ -852,8 +761,6 @@ install_perform_install() { 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 @@ -876,8 +783,7 @@ install_perform_install() { 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 @@ -885,8 +791,6 @@ install_perform_install() { 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 @@ -910,8 +814,7 @@ install_perform_install() { 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 @@ -919,8 +822,6 @@ install_perform_install() { 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 @@ -943,8 +844,7 @@ install_perform_install() { 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 @@ -952,8 +852,6 @@ install_perform_install() { 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 @@ -969,35 +867,6 @@ install_perform_install() { 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 @@ -1005,9 +874,6 @@ install_cleanup() { 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 } diff --git a/build/scripts/package.sh b/build/scripts/package.sh index a8d5871..d5e5f2f 100644 --- a/build/scripts/package.sh +++ b/build/scripts/package.sh @@ -53,8 +53,6 @@ package_main() { local path_destination=package/ local path_sources=./ local prepend= - local print_line_first="yes" - local print_line_last="yes" local verbosity=normal local verbose= local verbose_common= @@ -155,11 +153,6 @@ package_main() { p= fi - if [[ ${verbosity} == "quiet" ]] ; then - print_line_first="no" - print_line_last="no" - fi - package_handle_colors if [[ ${do_help} == "yes" ]] ; then @@ -178,11 +171,7 @@ package_main() { if [[ ${operation_failure} == "fail-multiple" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Only one operation may be specified at a time.${c_reset}" - - package_print_last fi package_cleanup @@ -201,11 +190,7 @@ package_main() { if [[ ! -f build/stand_alone/${i}.settings ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Unknown or unsupported stand alone program '${c_notice}${i}${c_error}'.${c_reset}" - - package_print_last fi package_cleanup @@ -227,11 +212,7 @@ package_main() { if [[ ${operation} == "build" || ${operation} == "rebuild" ]] ; then if [[ ! -d ${path_build} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Build directory '${c_notice}${path_build}${c_error}' is invalid or missing.${c_reset}" - - package_print_last fi package_cleanup @@ -244,11 +225,7 @@ package_main() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Package directory '${c_notice}${path_destination}${c_error}' is invalid or could not be created.${c_reset}" - - package_print_last fi package_cleanup @@ -259,11 +236,7 @@ package_main() { if [[ ! -d ${path_sources} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Sources directory '${c_notice}${path_sources}${c_error}' is invalid or missing.${c_reset}" - - package_print_last fi package_cleanup @@ -273,11 +246,7 @@ package_main() { if [[ ! -d ${path_sources}level_0/ ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Build sources directory '${c_notice}${path_sources}level_0/${c_error}' is invalid or missing.${c_reset}" - - package_print_last fi package_cleanup @@ -287,11 +256,7 @@ package_main() { if [[ ! -d ${path_sources}level_1/ ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Build sources directory '${c_notice}${path_sources}level_1/${c_error}' is invalid or missing.${c_reset}" - - package_print_last fi package_cleanup @@ -301,11 +266,7 @@ package_main() { if [[ ! -d ${path_sources}level_2/ ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Build sources directory '${c_notice}${path_sources}level_2/${c_error}' is invalid or missing.${c_reset}" - - package_print_last fi package_cleanup @@ -315,11 +276,7 @@ package_main() { if [[ ! -d ${path_sources}level_3/ ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Build sources directory '${c_notice}${path_sources}level_3/${c_error}' is invalid or missing.${c_reset}" - - package_print_last fi package_cleanup @@ -381,11 +338,7 @@ package_main() { elif [[ ${operation} == "dependencies" ]] ; then if [[ ! -d ${path_sources} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Sources directory '${c_notice}${path_sources}${c_error}' is invalid or missing.${c_reset}" - - package_print_last fi package_cleanup @@ -397,11 +350,7 @@ package_main() { elif [[ ${operation} == "clean" ]] ; then if [[ ! -d ${path_destination} ]] ; then if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first - echo -e "${c_warning}WARNING: Package directory '${c_notice}${path_destination}${c_error}' does not exist, there is nothing to clean.${c_reset}" - - package_print_last fi package_cleanup @@ -412,11 +361,7 @@ package_main() { package_operation_clean elif [[ ${operation} == "" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: No operation was given.${c_reset}" - - package_print_last fi package_cleanup @@ -424,11 +369,7 @@ package_main() { return 1 else if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: The operation ${c_notice}${operation}${c_error} was not recognized.${c_reset}" - - package_print_last fi package_cleanup @@ -436,12 +377,6 @@ package_main() { return 1 fi - if [[ ${verbosity} != "quiet" ]] ; then - if [[ ${failure} -eq 1 || ${verbosity} != "error" ]] ; then - package_print_last - fi - fi - package_cleanup if [[ ${failure} -eq 1 ]] ; then @@ -475,8 +410,6 @@ package_handle_colors() { package_help() { - package_print_first - echo -e "${c_title}${public_name}${c_reset}" echo -e " ${c_notice}Version ${version}${c_reset}" echo @@ -509,20 +442,15 @@ package_help() { echo -e " -${c_important}p${c_reset}, --${c_important}program${c_reset} Build program packages (level 3)." echo -e " -${c_important}s${c_reset}, --${c_important}sources${c_reset} Specify a custom sources directory." echo -e " -${c_important}S${c_reset}, --${c_important}stand_alone${c_reset} Build a specified program package as stand alone." - echo } package_copyright() { - package_print_first - 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-or-later." echo "Documentation license cc-by-sa-4.0." - - package_print_last } package_create_base_files() { @@ -532,8 +460,6 @@ package_create_base_files() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create directory ${c_notice}${package}${c_error}.${c_reset}" fi @@ -546,8 +472,6 @@ package_create_base_files() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy directory ${c_notice}${path_build}documents${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -561,8 +485,6 @@ package_create_base_files() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy directory ${c_notice}${path_build}licenses${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -573,8 +495,6 @@ package_create_base_files() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy directory ${c_notice}${path_build}../licenses${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -582,8 +502,6 @@ package_create_base_files() { fi else if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Neither directory ${c_notice}${path_build}licenses${c_error} nor ${c_notice}${path_build}../licenses${c_error} can be found or are invalid.${c_reset}" fi @@ -596,8 +514,6 @@ package_create_base_files() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy script ${c_notice}${path_build}bootstrap.sh${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -609,8 +525,6 @@ package_create_base_files() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to set executable permissions on script ${c_notice}${package}bootstrap.sh${c_error}.${c_reset}" fi @@ -623,8 +537,6 @@ package_create_base_files() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy script ${c_notice}${path_build}install.sh${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -637,8 +549,6 @@ package_create_base_files() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to set executable permissions on script ${c_notice}${package}install.sh${c_error}.${c_reset}" fi @@ -685,15 +595,12 @@ package_dependencies_individual() { level_current="$(echo ${directory} | grep -o '\<level_[[:digit:]]/' | sed -e 's|level_||' -e 's|/$||')" if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo -e "${c_highlight}Building Dependencies for ${c_reset}${c_notice}${name}${c_reset}${c_highlight}.${c_reset}" fi if [[ ! -d ${directory}/data/build/ ]] ; then if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first - echo -e "${c_warning}WARNING: The project build directory ${c_notice}${dependency_file}${c_warning} is not found.${c_reset}" fi @@ -724,14 +631,10 @@ package_dependencies_individual() { if [[ $dependency_files == "yes" && "${directory}/data/build/dependencies" != ${dependency_file} ]] ; then if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first - echo -e "${c_warning}WARNING: The dependency file ${c_notice}${dependency_file}${c_warning} is not found.${c_reset}" fi elif [[ $dependency_files == "no" && "${directory}/data/build/dependencies.*" != ${dependency_file} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Cannot build dependencies, failed to find ${c_notice}${dependency_file}${c_error} file(s).${c_reset}" fi fi @@ -747,8 +650,6 @@ package_dependencies_individual() { if [[ ! -f ${directory}/data/build/settings${dependency_suffix} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Cannot build dependencies for ${c_reset}${c_notice}${name}${c_reset}${c_error}, failed to find ${c_notice}${directory}/data/build/settings${dependency_suffix}${c_error}.${c_reset}" fi @@ -781,8 +682,6 @@ package_dependencies_individual() { level=level_2 else if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first - echo -e "${c_warning}WARNING: Failed to detect level for dependency ${c_notice}${dependency}${c_warning}.${c_reset}" fi @@ -791,8 +690,6 @@ package_dependencies_individual() { if [[ ! -d ${path_sources}${level}/${dependency}/data/build/ ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to find dependency data directory ${c_notice}${path_sources}${level}/${dependency}/data/build/${c_error}.${c_reset}" fi @@ -814,8 +711,6 @@ package_dependencies_individual() { sub_level=level_1 else if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first - echo -e "${c_warning}WARNING: Failed to detect level for sub-dependency ${c_notice}${sub_dependency}${c_warning}.${c_reset}" fi @@ -824,8 +719,6 @@ package_dependencies_individual() { if [[ ! -d ${path_sources}${sub_level}/${sub_dependency}/data/build/ ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to find dependency data directory ${c_notice}${path_sources}${sub_level}/${sub_dependency}/data/build/${c_error}.${c_reset}" fi @@ -845,8 +738,6 @@ package_dependencies_individual() { sub_sub_level=level_0 else if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first - echo -e "${c_warning}WARNING: Failed to detect level for sub-sub-dependency ${c_notice}${sub_sub_dependency}${c_warning}.${c_reset}" fi @@ -901,8 +792,6 @@ package_dependencies_individual() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to update settings file ${c_notice}${settings}${c_error}.${c_reset}" fi @@ -918,8 +807,6 @@ package_dependencies_individual() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to update settings file ${c_notice}${settings}${c_error}.${c_reset}" fi @@ -933,8 +820,6 @@ package_dependencies_individual() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to update settings file ${c_notice}${settings}${c_error}.${c_reset}" fi @@ -966,8 +851,6 @@ package_dependencies_individual_append() { settings=${path_sources}${level}/${dependency}/data/build/settings if [[ ! -f ${settings} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to find dependency settings file ${c_notice}${settings}${c_error}.${c_reset}" fi @@ -1069,8 +952,7 @@ package_dependencies_level_update() { local monolithic_headers_threaded= if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo -e "${c_highlight}Building Dependencies: ${c_notice}${level}${c_highlight}.${c_reset}" fi @@ -1081,8 +963,6 @@ package_dependencies_level_update() { settings=${directory}/data/build/settings if [[ ! -f ${settings} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to find settings file ${c_notice}${settings}${c_error}.${c_reset}" fi @@ -1122,8 +1002,6 @@ package_dependencies_level_update() { if [[ ! -f ${settings} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to find settings file ${c_notice}${settings}${c_error}.${c_reset}" fi @@ -1137,8 +1015,6 @@ package_dependencies_level_update() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to update libraries for settings file ${c_notice}${settings}${c_error}.${c_reset}" fi @@ -1160,8 +1036,6 @@ package_dependencies_level_update() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to update libraries for settings file ${c_notice}${settings}${c_error}.${c_reset}" fi @@ -1183,8 +1057,6 @@ package_dependencies_level_update() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to update headers for settings file ${c_notice}${settings}${c_error}.${c_reset}" fi @@ -1223,8 +1095,7 @@ package_dependencies_monolithic() { local monolithic_headers_threaded="" if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo -e "${c_highlight}Building Dependencies: ${c_notice}monolithic${c_highlight}.${c_reset}" fi @@ -1333,8 +1204,6 @@ package_dependencies_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to update libraries for settings file ${c_notice}${settings}${c_error}.${c_reset}" fi @@ -1366,8 +1235,6 @@ package_dependencies_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to update headers for settings file ${c_notice}${settings}${c_error}.${c_reset}" fi @@ -1383,8 +1250,7 @@ package_operation_clean() { local i= if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo -e "${c_highlight}Cleaning Package Directory '${c_reset}${c_notice}${path_destination}${c_reset}${c_highlight}'.${c_reset}" fi @@ -1400,8 +1266,7 @@ package_operation_clean() { fi if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo "Cleaned '${path_destination}individual'." fi fi @@ -1418,8 +1283,7 @@ package_operation_clean() { fi if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo "Cleaned '${path_destination}level'." fi fi @@ -1436,8 +1300,7 @@ package_operation_clean() { fi if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo "Cleaned '${path_destination}monolithic'." fi fi @@ -1454,8 +1317,7 @@ package_operation_clean() { fi if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo "Cleaned '${path_destination}program'." fi fi @@ -1476,8 +1338,7 @@ package_operation_clean() { fi if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo "Cleaned '${path_destination}stand_alone/${prepend}${i}-${version}/'." fi done @@ -1485,8 +1346,7 @@ package_operation_clean() { rmdir ${verbose_common} --ignore-fail-on-non-empty ${path_destination}stand_alone if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo "Cleaned '${path_destination}stand_alone'." fi fi @@ -1502,8 +1362,6 @@ package_operation_copy_package() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy the data directory ${c_notice}${package}sources/data${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -1516,8 +1374,6 @@ package_operation_copy_package() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to remove directory ${c_notice}${package}sources/data${c_error}.${c_reset}" fi @@ -1534,8 +1390,6 @@ package_operation_copy_package() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to move sources documents directory ${c_notice}${path_sources}sources/documents${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -1548,8 +1402,6 @@ package_operation_copy_package() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to remove sources documents directory ${c_notice}${path_sources}sources/documents${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -1564,8 +1416,6 @@ package_operation_copy_package() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to move sources licenses directory ${c_notice}${path_sources}sources/licenses${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -1578,8 +1428,6 @@ package_operation_copy_package() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to remove sources licenses directory ${c_notice}${path_sources}sources/licenses${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -1594,8 +1442,6 @@ package_operation_copy_package() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to move sources specifications directory ${c_notice}${path_sources}sources/specifications${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -1608,8 +1454,6 @@ package_operation_copy_package() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to remove sources specifications directory ${c_notice}${path_sources}sources/specifications${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -1624,8 +1468,6 @@ package_operation_copy_package() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to move sources tests directory ${c_notice}${path_sources}sources/tests${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -1638,8 +1480,6 @@ package_operation_copy_package() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to remove sources tests directory ${c_notice}${path_sources}sources/tests${c_error} to ${c_notice}${package}${c_error}.${c_reset}" fi @@ -1672,8 +1512,6 @@ package_operation_create_config_stubs() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to insert the config.c into ${c_notice}${package}data/build/settings${c_error}.${c_reset}" fi @@ -1686,8 +1524,6 @@ package_operation_create_config_stubs() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to insert the config.c into ${c_notice}${package}data/build/settings${c_error}.${c_reset}" fi @@ -1703,8 +1539,6 @@ package_operation_create_config_stubs() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create the config.c at ${c_notice}${package}sources/c/config.c${c_error}.${c_reset}" fi @@ -1719,8 +1553,6 @@ package_operation_create_config_stubs() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to insert the config.cpp into ${c_notice}${package}data/build/settings${c_error}.${c_reset}" fi @@ -1733,8 +1565,6 @@ package_operation_create_config_stubs() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to insert the config.cpp into ${c_notice}${package}data/build/settings${c_error}.${c_reset}" fi @@ -1750,8 +1580,6 @@ package_operation_create_config_stubs() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create the config.cpp at ${c_notice}${package}sources/c++/config.cpp${c_error}.${c_reset}" fi @@ -1768,8 +1596,6 @@ package_operation_create_config_stubs() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create the config.cpp at ${c_notice}${package}sources/c/config.h${c_error}.${c_reset}" fi @@ -1782,8 +1608,6 @@ package_operation_create_config_stubs() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create the config.cpp at ${c_notice}${package}sources/c++/config.h${c_error}.${c_reset}" fi @@ -1832,8 +1656,6 @@ package_operation_individual() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create directory ${c_notice}${path_destination}individual${c_error}.${c_reset}" fi @@ -1847,8 +1669,7 @@ package_operation_individual() { package="${path_destination}individual/${prepend}${name}-${version}/" if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo -e "${c_highlight}Packaging Project${c_reset} (individual) ${c_notice}${prepend}${name}-${version}${c_reset}${c_highlight}.${c_reset}" fi @@ -1858,8 +1679,6 @@ package_operation_individual() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy sources directory ${c_notice}${directory}${c_error} to ${c_notice}${package}sources${c_error}.${c_reset}" fi @@ -1894,15 +1713,12 @@ package_operation_level() { package="${path_destination}level/${prepend}${name}-${version}/" if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo -e "${c_highlight}Packaging Project${c_reset} (level) ${c_notice}${prepend}${name}-${version}${c_reset}${c_highlight}.${c_reset}" fi if [[ ! -d ${path_build}${level} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Build settings directory ${c_notice}${path_build}${level}${c_error} is invalid or missing.${c_reset}" fi @@ -1918,8 +1734,6 @@ package_operation_level() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create directory ${c_notice}${package}data${c_error}.${c_reset}" fi @@ -1937,8 +1751,6 @@ package_operation_level() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to move the directory ${c_notice}${path_build}${level}${c_error} as ${c_notice}${path_build}${level}build${c_error}.${c_reset}" fi @@ -1952,8 +1764,6 @@ package_operation_level() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create directory ${c_notice}${package}sources${c_error}.${c_reset}" fi @@ -1969,8 +1779,6 @@ package_operation_level() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy files from sources directory ${c_notice}${directory}${c_error} to ${c_notice}${package}sources${c_error}.${c_reset}" fi @@ -1983,8 +1791,6 @@ package_operation_level() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to remove directory ${c_notice}${package}sources/data/build${c_error}.${c_reset}" fi @@ -2023,15 +1829,12 @@ package_operation_monolithic() { package="${path_destination}monolithic/${prepend}${name}-${version}/" if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo -e "${c_highlight}Packaging Project${c_reset} (monolithic) ${c_notice}${prepend}${name}-${version}${c_reset}${c_highlight}.${c_reset}" fi if [[ ! -d ${path_build}monolithic ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Build settings directory ${c_notice}${path_build}monolithic${c_error} is invalid or missing.${c_reset}" fi @@ -2047,8 +1850,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create directory ${c_notice}${package}data${c_error}.${c_reset}" fi @@ -2066,8 +1867,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to move the directory ${c_notice}${path_build}${level}${c_error} as ${c_notice}${path_build}${level}build${c_error}.${c_reset}" fi @@ -2081,8 +1880,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create directory ${c_notice}${package}sources${c_error}.${c_reset}" fi @@ -2097,8 +1894,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create directory ${c_notice}${package}tests${c_error}.${c_reset}" fi @@ -2122,8 +1917,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create package data directory ${c_notice}${package}data/${level}${c_error}.${c_reset}" fi @@ -2137,8 +1930,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy files from data directory ${c_notice}${directory_sub}${c_error} to ${c_notice}${package}sources/data${level}${c_error}.${c_reset}" fi @@ -2151,8 +1942,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to remove directory ${c_notice}${package}sources/data/build${c_error}.${c_reset}" fi @@ -2166,8 +1955,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy the data directory ${c_notice}${package}sources/data/${level}/data${c_error} to ${c_notice}${package}data/${level}${c_error}.${c_reset}" fi @@ -2181,8 +1968,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to remove directory ${c_notice}${package}sources/data${c_error}.${c_reset}" fi @@ -2196,8 +1981,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy directory ${c_notice}${package}data/${level}/documentation${c_error} into ${c_notice}${package}data${c_error}.${c_reset}" fi @@ -2211,8 +1994,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to remove directory ${c_notice}${package}data/${level}/documentation${c_error}.${c_reset}" fi @@ -2226,8 +2007,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy files from data directory ${c_notice}${directory_sub}${c_error} to ${c_notice}${package}sources/documents${c_error}.${c_reset}" fi @@ -2242,8 +2021,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy files from data directory ${c_notice}${directory_sub}${c_error} to ${c_notice}${package}sources/licenses${c_error}.${c_reset}" fi @@ -2258,8 +2035,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy files from data directory ${c_notice}${directory_sub}${c_error} to ${c_notice}${package}sources/specifications${c_error}.${c_reset}" fi @@ -2274,8 +2049,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy files from data directory ${c_notice}${directory_sub}${c_error} to ${c_notice}${package}tests${c_error}.${c_reset}" fi @@ -2290,8 +2063,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create package sources directory ${c_notice}${package}sources/${path_name}/${level}${c_error}.${c_reset}" fi @@ -2305,8 +2076,6 @@ package_operation_monolithic() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy files from sources directory ${c_notice}${directory_sub}${c_error} to ${c_notice}${package}sources/${path_name}/${level}${c_error}.${c_reset}" fi @@ -2352,8 +2121,6 @@ package_operation_program() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create directory ${c_notice}${path_destination}program${c_error}.${c_reset}" fi @@ -2369,8 +2136,7 @@ package_operation_program() { package="${path_destination}program/${prepend}${name}-${version}/" if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo -e "${c_highlight}Packaging Project${c_reset} (program) ${c_notice}${prepend}${name}-${version}${c_reset}${c_highlight}.${c_reset}" fi @@ -2380,8 +2146,6 @@ package_operation_program() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy sources directory ${c_notice}${directory}${c_error} to ${c_notice}${package}sources${c_error}.${c_reset}" fi @@ -2425,8 +2189,6 @@ package_operation_stand_alone() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create directory ${c_notice}${path_destination}stand_alone${c_error}.${c_reset}" fi @@ -2442,8 +2204,7 @@ package_operation_stand_alone() { package="${path_destination}stand_alone/${prepend}${name}-${version}/" if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - package_print_first_or_always - + echo echo -e "${c_highlight}Packaging Project${c_reset} (stand_alone) ${c_notice}${prepend}${name}-${version}${c_reset}${c_highlight}.${c_reset}" fi @@ -2459,8 +2220,6 @@ package_operation_stand_alone() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy sources directory ${c_notice}${directory}${c_error} to ${c_notice}${package}sources${c_error}.${c_reset}" fi @@ -2481,8 +2240,6 @@ package_operation_stand_alone() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy file ${c_notice}${path_build}stand_alone/${name}.settings${c_error} to ${c_notice}${package}data/build/settings${c_error}.${c_reset}" fi @@ -2495,8 +2252,6 @@ package_operation_stand_alone() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy file ${c_notice}${path_build}stand_alone/${name}.fakefile${c_error} to ${c_notice}${package}data/build/fakefile${c_error}.${c_reset}" fi @@ -2510,8 +2265,6 @@ package_operation_stand_alone() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create package sources directory ${c_notice}${package}sources/c/program/${name}/${c_error}.${c_reset}" fi @@ -2540,8 +2293,6 @@ package_operation_stand_alone() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create package sources directory ${c_notice}${package}sources/${path_name}/program/${name}/${c_error}.${c_reset}" fi @@ -2555,8 +2306,6 @@ package_operation_stand_alone() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to move path ${c_notice}${path_sub}${c_error} to ${c_notice}${package}sources/${path_name}/program/${name}/${c_error}.${c_reset}" fi @@ -2580,8 +2329,6 @@ package_operation_stand_alone() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy file ${c_notice}${path_build}stand_alone/config.h${c_error} to ${c_notice}${package}sources/c/${c_error}.${c_reset}" fi @@ -2625,8 +2372,6 @@ package_operation_stand_alone() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to create package sources directory ${c_notice}${package}sources/${path_name}/fll/${level}/${c_error}.${c_reset}" fi @@ -2640,8 +2385,6 @@ package_operation_stand_alone() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - package_print_first - echo -e "${c_error}ERROR: Failed to copy files from sources directory ${c_notice}${directory_level}${path_name}/${c_error} to ${c_notice}${package}sources/${path_name}/fll/${level}/${c_error}.${c_reset}" fi @@ -2670,35 +2413,6 @@ package_operation_stand_alone() { return 0 } -package_print_first() { - - if [[ ${print_line_first} == "yes" ]] ; then - echo - - print_line_first= - fi -} - -package_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 -} - -package_print_last() { - - if [[ ${print_line_last} == "yes" ]] ; then - echo - fi -} - package_cleanup() { unset package_copyright @@ -2721,9 +2435,6 @@ package_cleanup() { unset package_operation_monolithic unset package_operation_program unset package_operation_stand_alone - unset package_print_first - unset package_print_first_or_always - unset package_print_last unset package_cleanup } diff --git a/build/scripts/test.sh b/build/scripts/test.sh index 4b3642f..d0d7dff 100644 --- a/build/scripts/test.sh +++ b/build/scripts/test.sh @@ -57,8 +57,6 @@ test_main() { local path_test_package_stand_alone=${path_test_package}stand_alone/ local path_test_project=${path_test}project/ local path_test_work=${path_test}work/ - local print_line_first="yes" - local print_line_last="yes" local test_system= local test_thread="thread" local test_thread_individual="individual_thread" @@ -175,11 +173,6 @@ test_main() { p= fi - if [[ ${verbosity} == "quiet" ]] ; then - print_line_first="no" - print_line_last="no" - fi - test_handle_colors if [[ ${do_help} == "yes" ]] ; then @@ -198,8 +191,6 @@ test_main() { if [[ ${operation_failure} == "fail-too_many" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Only a single build system is supported, received the following test systems ${c_notice}${test_system} ${operation}${c_error} was not recognized.${c_reset}" fi @@ -216,8 +207,6 @@ test_main() { if [[ ${failure} -eq 0 && ${test_system} != "normal" && ${test_system} != "github" && ${test_system} != "gitlab" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: The test system must be one of ${c_notice}normal${c_error}, ${c_notice}github${c_error}, or ${c_notice}gitlab${c_error}.${c_reset}" fi @@ -226,8 +215,6 @@ test_main() { if [[ ${failure} -eq 0 && ${build_compiler} != "gcc" && ${build_compiler} != "clang" ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: The build compiler ${c_notice}${build_compiler}${c_error} is not currently directly supported.${c_reset}" fi @@ -236,8 +223,6 @@ test_main() { if [[ ${failure} -eq 0 && ! -d ${path_scripts} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: The build scripts path ${c_notice}${path_scripts}${c_error} is not a valid directory.${c_reset}" fi @@ -246,8 +231,6 @@ test_main() { if [[ ${failure} -eq 0 && ! -f ${path_scripts_package} ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Unable to find the package build script file under the build scripts path at ${c_notice}${path_scripts_package}${c_error}.${c_reset}" fi @@ -259,8 +242,6 @@ test_main() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: The test path ${c_notice}${path_test}${c_error}, does not exist and could not be created or exists and is not a valid directory.${c_reset}" fi @@ -273,8 +254,6 @@ test_main() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: The package path ${c_notice}${path_test_package}${c_error}, does not exist and could not be created or exists and is not a valid directory.${c_reset}" fi @@ -287,8 +266,6 @@ test_main() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: The test project path ${c_notice}${path_test_project}${c_error}, does not exist and could not be created or exists and is not a valid directory.${c_reset}" fi @@ -301,8 +278,6 @@ test_main() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: The test work path ${c_notice}${path_test_work}${c_error}, does not exist and could not be created or exists and is not a valid directory.${c_reset}" fi @@ -312,13 +287,8 @@ test_main() { if [[ ${failure} -eq 0 ]] ; then test_operate - let failure=$? - fi - if [[ ${verbosity} != "quiet" ]] ; then - if [[ ${failure} -eq 1 || ${verbosity} != "error" ]] ; then - test_print_last - fi + let failure=$? fi test_cleanup @@ -354,8 +324,6 @@ test_handle_colors() { test_help() { - test_print_first - echo -e "${c_title}${public_name}${c_reset}" echo -e " ${c_notice}Version ${version}${c_reset}" echo @@ -384,21 +352,15 @@ test_help() { echo -e " -${c_important}t${c_reset}, --${c_important}path_test${c_reset} Specify a custom directory where the test environment is found." echo -e " -${c_important}T${c_reset}, --${c_important}thread${c_reset} Compile code being tested with threads enabled." echo -e " -${c_important}L${c_reset}, --${c_important}threadless${c_reset} Compile code being tested with threads disabled." - - test_print_last } test_copyright() { - test_print_first - 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-or-later." echo "Documentation license cc-by-sa-4.0." - - test_print_last } test_operate() { @@ -453,16 +415,13 @@ test_operate_build_individual() { local path_original="${PWD}/" if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - test_print_first_or_always - + echo echo -e "${c_highlight}Cleaning and building individual package.${c_reset}" echo -e "${c_title}-----------------------------------------${c_reset}" echo fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "${shell_command} ${path_scripts_package} ${verbose} ${context} -d ${path_test_package} -i rebuild" fi @@ -470,8 +429,6 @@ test_operate_build_individual() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to clean and build the individual packages.${c_reset}" fi @@ -507,16 +464,13 @@ test_operate_build_program() { local path_original="${PWD}/" if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - test_print_first_or_always - + echo echo -e "${c_highlight}Cleaning and building program packages.${c_reset}" echo -e "${c_title}---------------------------------------${c_reset}" echo fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "${shell_command} ${path_scripts_package} ${verbose} ${context} -d ${path_test_package} -p rebuild" fi @@ -524,8 +478,6 @@ test_operate_build_program() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to clean and build the program packages.${c_reset}" fi @@ -564,8 +516,6 @@ test_operate_build_project() { if [[ ! -d ${path_}${project}-${version}/ ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Package directory '${c_notice}${path_}${project}-${version}${c_error}' is invalid or missing.${c_reset}" fi @@ -575,8 +525,6 @@ test_operate_build_project() { fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo -e "Running '${c_notice}cd ${path_}${project}-${version}/${c_reset}'." fi @@ -584,8 +532,6 @@ test_operate_build_project() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to change into directory '${c_notice}${path_}${project}-${version}${c_error}'.${c_reset}" fi @@ -596,8 +542,6 @@ test_operate_build_project() { if [[ ${bootstrap} == "" ]] ; then if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - if [[ ${build_compiler} == "gcc" ]] ; then echo "PATH=\"${env_path}\" LD_LIBRARY_PATH=\"${env_libs}\" fake ${verbose} ${context} -w \"${destination}\" -m ${mode} ${mode_thread_param} ${mode_thread_value} ${mode_thread_individual_param} ${mode_thread_individual_value} -m test ${analyze_flag} ${analyze_value} clean build ${ci_arguments}" else @@ -613,8 +557,6 @@ test_operate_build_project() { else if [[ ${SHELL_ENGINE} == "zsh" ]] ; then if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - if [[ ${build_compiler} == "gcc" ]] ; then echo "zsh ./bootstrap.sh ${verbose} ${context} -w \"${destination}\" -m ${mode} ${mode_thread_param} ${mode_thread_value} ${mode_thread_individual_param} ${mode_thread_individual_value} -m test ${analyze_flag} ${analyze_value} build" else @@ -629,8 +571,6 @@ test_operate_build_project() { fi else if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - if [[ ${build_compiler} == "gcc" ]] ; then echo "./bootstrap.sh ${verbose} ${context} -w \"${destination}\" -m ${mode} ${mode_thread_individual_param} ${mode_thread_individual_value} ${mode_thread_param} ${mode_thread_value} -m test ${analyze_flag} ${analyze_value} build" else @@ -648,8 +588,6 @@ test_operate_build_project() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to build ${mode} project '${c_notice}${project}${c_reset}${c_error}'.${c_reset}" fi @@ -671,8 +609,6 @@ test_operate_build_project() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to install ${mode} project '${c_notice}${project}${c_reset}${c_error}'.${c_reset}" fi @@ -688,16 +624,13 @@ test_operate_build_tools() { local path_original="${PWD}/" if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - test_print_first_or_always - + echo echo -e "${c_highlight}Building project build tools.${c_reset}" echo -e "${c_title}-----------------------------${c_reset}" echo fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "${shell_command} ${path_scripts_package} ${verbose} ${context} -d ${path_test_package} -S fake rebuild" fi @@ -705,8 +638,6 @@ test_operate_build_tools() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to clean and build the stand_alone fake package.${c_reset}" fi @@ -740,8 +671,7 @@ test_operate_ci_prebuild() { fi if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - test_print_first_or_always - + echo echo -e "${c_highlight}Performing Github Specific Pre-Build Operations.${c_reset}" echo -e "${c_title}------------------------------------------------${c_reset}" echo @@ -772,8 +702,7 @@ test_operate_ci_pretest() { fi if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - test_print_first_or_always - + echo echo -e "${c_highlight}Performing Github Specific Pre-Test Operations.${c_reset}" echo -e "${c_title}-----------------------------------------------${c_reset}" echo @@ -804,8 +733,6 @@ test_operate_ci_pretest_cmocka() { if [[ -d ${cmocka_path} ]] ; then if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - test_print_first_or_always - echo -e "Detected existing cmocka repository at \"${c_notice}${cmocka_path}${c_reset}\", skipping the cmocka process." fi @@ -813,8 +740,6 @@ test_operate_ci_pretest_cmocka() { fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "git clone ${clone_quiet} --single-branch -b ${cmocka_branch} \"${cmocka_uri}\" ${cmocka_path}" fi @@ -822,8 +747,6 @@ test_operate_ci_pretest_cmocka() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to git clone '${c_notice}${cmocka_uri}${c_error}' onto '${c_notice}${cmocka_path}${c_error}'.${c_reset}" fi @@ -833,8 +756,6 @@ test_operate_ci_pretest_cmocka() { fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "mkdir ${verbose_common} -p ${cmocka_data}" fi @@ -842,8 +763,6 @@ test_operate_ci_pretest_cmocka() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to create cmocka build data directory '${c_notice}${cmocka_data}${c_error}'.${c_reset}" fi @@ -853,8 +772,6 @@ test_operate_ci_pretest_cmocka() { fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "cp ${verbose_common} ${cmocka_settings} ${cmocka_data}" fi @@ -862,8 +779,6 @@ test_operate_ci_pretest_cmocka() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to copy cmocka build settings: '${c_notice}${cmocka_settings}${c_error}'.${c_reset}" fi @@ -873,8 +788,6 @@ test_operate_ci_pretest_cmocka() { fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "cd ${cmocka_path}" fi @@ -882,8 +795,6 @@ test_operate_ci_pretest_cmocka() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to change cmocka source directory '${c_notice}${cmocka_path}${c_error}'.${c_reset}" fi @@ -893,8 +804,6 @@ test_operate_ci_pretest_cmocka() { fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "PATH=\"${env_path}\" LD_LIBRARY_PATH=\"${env_libs}\" fake ${verbose} ${context} -w \"${path_test_work}\" -m ${build_compiler} -m ${test_thread} clean build ${ci_arguments}" fi @@ -902,8 +811,6 @@ test_operate_ci_pretest_cmocka() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to build '${c_notice}cmocka${c_error}'.${c_reset}" fi @@ -913,8 +820,6 @@ test_operate_ci_pretest_cmocka() { fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "cp ${verbose_common} -R ${cmocka_build}includes/* ${work_path}includes/" fi @@ -922,8 +827,6 @@ test_operate_ci_pretest_cmocka() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to install cmocka headers to '${c_notice}${work_path}includes/${c_error}'.${c_reset}" fi @@ -933,8 +836,6 @@ test_operate_ci_pretest_cmocka() { fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "cp ${verbose_common} -R ${cmocka_build}libraries/shared/* ${work_path}libraries/shared/" fi @@ -942,8 +843,6 @@ test_operate_ci_pretest_cmocka() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to install cmocka libraries to '${c_notice}${work_path}libraries/shared/${c_error}'.${c_reset}" fi @@ -962,8 +861,6 @@ test_operate_ci_prebuild_libcap() { if [[ -d ${libcap_path} ]] ; then if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - test_print_first_or_always - echo -e "Detected existing libcap repository at \"${c_notice}${libcap_path}${c_reset}\", skipping the libcap process." fi @@ -971,8 +868,6 @@ test_operate_ci_prebuild_libcap() { fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "git clone ${clone_quiet} --single-branch -b ${libcap_branch} \"${libcap_uri}\" ${libcap_path}" fi @@ -980,8 +875,6 @@ test_operate_ci_prebuild_libcap() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to git clone '${c_notice}${libcap_uri}${c_error}' onto '${c_notice}${libcap_path}${c_error}'.${c_reset}" fi @@ -991,8 +884,6 @@ test_operate_ci_prebuild_libcap() { fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "cd ${libcap_path}" fi @@ -1000,11 +891,7 @@ test_operate_ci_prebuild_libcap() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to change libcap source directory '${c_notice}${libcap_path}${c_error}'.${c_reset}" - - test_print_last fi let failure=1 @@ -1013,8 +900,6 @@ test_operate_ci_prebuild_libcap() { fi if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo "make MANDIR=${work_path}fake/ SBINDIR=${work_path}fake/ INCDIR=${work_path}includes/ LIBDIR=${work_path}libraries/shared/ PKGCONFIGDIR=${work_path}fake/ install" fi @@ -1022,11 +907,7 @@ test_operate_ci_prebuild_libcap() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to build and install libcap into the work directory '${c_notice}${work_path}${c_error}'.${c_reset}" - - test_print_last fi let failure=1 @@ -1067,8 +948,6 @@ test_operate_tests_change_to() { if [[ ${failure} -eq 0 ]] ; then if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo -e "Running '${c_notice}cd ${destination}${c_reset}'." fi @@ -1076,11 +955,7 @@ test_operate_tests_change_to() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failed to change into directory '${c_notice}${destination}${c_error}'.${c_reset}" - - test_print_last fi let failure=1 @@ -1093,8 +968,7 @@ test_operate_tests_name() { local name=${2} if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - test_print_first_or_always - + echo echo -e "${c_highlight}Testing ${what} ${name}.${c_reset}" echo -e "${c_title}--------------------------------------${c_reset}" echo @@ -1107,11 +981,7 @@ test_operate_tests_path_exists() { if [[ ! -d ${path_name}/ ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: ${what} directory '${c_notice}${path_name}${c_error}' is invalid or missing.${c_reset}" - - test_print_last fi let failure=1 @@ -1131,13 +1001,9 @@ test_operate_tests_projects() { if [[ ! -f ${path_test_package_individual}${project}-${version}/data/build/testfile ]] ; then if [[ $(echo ${projects_no_tests} | grep -o "\<${project}\>") == "" ]] ; then if [[ ${verbosity} == "verbose" || ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo -e "${c_warning}WARNING: Project '${c_notice}${project}${c_warning}' does not have a testfile.${c_reset}" fi else - test_print_first_or_always - echo -e "Project '${c_notice}${project}${c_reset}' has no tests and is not expected to.${c_reset}" fi @@ -1175,8 +1041,6 @@ test_operate_tests_programs() { if [[ ${failure} -eq 0 ]] ; then if [[ ! -f ${path_test_package_program}${program}-${version}/data/build/testfile ]] ; then if [[ ${verbosity} == "verbose" || ${verbosity} == "debug" ]] ; then - test_print_first_or_always - echo -e "${c_warning}WARNING: Program '${c_notice}${program}${c_warning}' does not have a testfile.${c_reset}" fi @@ -1208,8 +1072,6 @@ test_operate_tests_run() { if [[ ${failure} -eq 0 ]] ; then if [[ ${verbosity} == "debug" ]] ; then - test_print_first_or_always - if [[ ${build_compiler} == "gcc" ]] ; then echo "PATH=\"${env_path}\" LD_LIBRARY_PATH=\"${env_libs}\" fake ${verbose} ${context} -w \"${destination}\" -m individual -m ${test_thread} ${thread_individual_param} ${thread_individual_value} -m test ${analyze_flag} ${analyze_value} clean make -f testfile ${ci_arguments}" else @@ -1225,11 +1087,7 @@ test_operate_tests_run() { if [[ ${?} -ne 0 ]] ; then if [[ ${verbosity} != "quiet" ]] ; then - test_print_first - echo -e "${c_error}ERROR: Failure while testing ${what} '${c_notice}${name}${c_reset}${c_error}'.${c_reset}" - - test_print_last fi let failure=1 @@ -1237,35 +1095,6 @@ test_operate_tests_run() { fi } -test_print_first() { - - if [[ ${print_line_first} == "yes" ]] ; then - echo - - print_line_first= - fi -} - -test_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 -} - -test_print_last() { - - if [[ ${print_line_last} == "yes" ]] ; then - echo - fi -} - test_cleanup() { unset test_copyright @@ -1287,9 +1116,6 @@ test_cleanup() { unset test_operate_tests_projects unset test_operate_tests_programs unset test_operate_tests_run - unset test_print_first - unset test_print_first_or_always - unset test_print_last unset test_cleanup } -- 1.8.3.1