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_mode_extra_param_2=
build_mode_extra_value_2=
shell_command=bash
-suppress_first=""
exclude_programs=
grab_next=
skip=
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
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
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.
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
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
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=
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}"
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
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
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
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
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
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
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
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
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
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
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
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
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
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
return 1
fi
- if [[ ${verbosity} != "quiet" ]] ; then
- if [[ ${failure} -eq 1 || ${verbosity} != "error" ]] ; then
- bootstrap_print_last
- fi
- fi
-
bootstrap_cleanup
return 0
bootstrap_help() {
- bootstrap_print_first
-
echo -e "${c_title}${public_name}${c_reset}"
echo -e " ${c_notice}Version ${version}${c_reset}"
echo
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() {
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
if [[ ${failure} -eq 1 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- bootstrap_print_first
-
echo -e "${c_error}ERROR: Failed to build.${c_reset}"
fi
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
}
local failure=0
local file=
local name=
- local print_line_first="yes"
- local print_line_last="yes"
local source="./"
local verbosity=normal
local verbose=
p=
fi
- if [[ ${verbosity} == "quiet" ]] ; then
- print_line_first="no"
- print_line_last="no"
- fi
-
generate_ctags_handle_colors
if [[ ${do_help} == "yes" ]] ; then
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
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
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
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
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
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
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
generate_ctags_help() {
- generate_ctags_print_first
-
echo -e "${c_title}${public_name}${c_reset}"
echo -e " ${c_notice}Version ${version}${c_reset}"
echo
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() {
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
}
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=$#
p=
fi
- if [[ ${verbosity} == "quiet" ]] ; then
- print_line_first="no"
- print_line_last="no"
- fi
-
install_handle_colors
if [[ ${do_help} == "yes" ]] ; then
if [[ ${operation_failure} == "fail-unsupported" ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The operation ${c_notice}${operation}${c_error} was not recognized.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ! -d ${path_build} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The build path ${c_notice}${path_build}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && ${destination_prefix} != "" && ! -d ${destination_prefix} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination prefix ${c_notice}${destination_prefix}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} != "" && ! -d ${work} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The work directory ${c_notice}${work}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && -e ${destination_programs} && ! -d ${destination_programs} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination bindir ${c_notice}${destination_programs}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && -e ${destination_programs_static} && ! -d ${destination_programs_static} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination (${c_notice}static${c_error}) bindir ${c_notice}${destination_programs_static}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && -e ${destination_programs_shared} && ! -d ${destination_programs_shared} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination (${c_notice}shared${c_error}) bindir ${c_notice}${destination_programs_shared}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && -e ${destination_includes} && ! -d ${destination_includes} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination incluedir ${c_notice}${destination_includes}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && -e ${destination_libraries_static} && ! -d ${destination_libraries_static} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination (${c_notice}static${c_error}) libdir ${c_notice}${destination_libraries_static}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
if [[ ${work} == "" && -e ${destination_libraries_shared} && ! -d ${destination_libraries_shared} ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: The destination (${c_notice}shared${c_error}) libdir ${c_notice}${destination_libraries_shared}${c_error} is not a valid directory.${c_reset}"
-
- install_print_last
fi
install_cleanup
install_perform_install
- if [[ ${verbosity} != "quiet" ]] ; then
- if [[ ${failure} -eq 1 || ${verbosity} != "error" ]] ; then
- install_print_last
- fi
- fi
-
install_cleanup
if [[ ${failure} -eq 1 ]] ; then
install_help() {
- install_print_first
-
echo -e "${c_title}${public_name}${c_reset}"
echo -e " ${c_notice}Version ${version}${c_reset}"
echo
echo -e " --${c_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() {
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_prefix}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_programs}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_programs_shared}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_programs_static}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_libraries}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_libraries_shared}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_libraries_static}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_includes}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_documentation}${c_error}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_settings}${c_error}.${c_reset}"
fi
if [[ ${file} != "" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing Includes to: ${c_reset}${c_notice}${destination_includes}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to copy include files from ${c_notice}${path_build}${path_includes}${c_error} to ${c_notice}${destination_includes}${c_error}.${c_reset}"
fi
if [[ ${file} != "" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing (${c_notice}static${c_highlight}) Libraries to: ${c_reset}${c_notice}${destination_libraries_static}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to copy (${c_notice}static${c_error}) library files from ${c_notice}${path_build}${path_libraries}${path_static}${c_error} to ${c_notice}${destination_libraries_static}${c_error}.${c_reset}"
fi
if [[ ${file} != "" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing (${c_notice}shared${c_highlight}) Libraries to: ${c_reset}${c_notice}${destination_libraries_shared}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: Failed to copy (${c_notice}shared${c_error}) library files from ${c_notice}${path_build}${path_libraries}${path_shared}${c_error} to ${c_notice}${destination_libraries_shared}${c_error}.${c_reset}"
fi
if [[ ${file} != "" && ${enable_static_programs} == "yes" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing (${c_notice}static${c_highlight}) Programs to: ${c_reset}${c_notice}${destination_programs_static}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: failed to copy (${c_notice}static${c_error}) program files from ${c_notice}${path_build}${path_programs}${path_static}${c_error} to ${c_notice}${destination_programs_static}${c_error}.${c_reset}"
fi
if [[ ${file} != "" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing (${c_notice}shared${c_highlight}) Programs to: ${c_reset}${c_notice}${destination_programs_shared}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: failed to copy (${c_notice}shared${c_error}) program files from ${c_notice}${path_build}${path_programs}${path_shared}${c_error} to ${c_notice}${destination_programs_shared}${c_error}.${c_reset}"
fi
if [[ ${file} != "" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing Settings to: ${c_reset}${c_notice}${destination_settings}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: failed to copy settings files from ${c_notice}${path_build}${path_settings}${c_error} to ${c_notice}${destination_settings}${c_error}.${c_reset}"
fi
if [[ ${file} != "" ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- install_print_first_or_always
-
+ echo
echo -e "${c_highlight}Installing Documentation to: ${c_reset}${c_notice}${destination_documentation}${c_reset}${c_highlight}.${c_reset}"
fi
if [[ ${?} -ne 0 ]] ; then
if [[ ${verbosity} != "quiet" ]] ; then
- install_print_first
-
echo -e "${c_error}ERROR: failed to copy documentation files from ${c_notice}${path_build}${path_documentation}${c_error} to ${c_notice}${destination_documentation}${c_error}.${c_reset}"
fi
return 0
}
-install_print_first() {
-
- if [[ ${print_line_first} == "yes" ]] ; then
- echo
-
- print_line_first=
- fi
-}
-
-install_print_first_or_always() {
-
- if [[ ${print_line_first} == "yes" ]] ; then
- echo
-
- print_line_first=
- elif [[ ${print_line_first} == "no" ]] ; then
- print_line_first=
- else
- echo
- fi
-}
-
-install_print_last() {
-
- if [[ ${print_line_last} == "yes" ]] ; then
- echo
- fi
-}
-
install_cleanup() {
unset install_copyright
unset install_handle_colors
unset install_help
unset install_perform_install
- unset install_print_first
- unset install_print_first_or_always
- unset install_print_last
unset install_cleanup
}
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=
p=
fi
- if [[ ${verbosity} == "quiet" ]] ; then
- print_line_first="no"
- print_line_last="no"
- fi
-
package_handle_colors
if [[ ${do_help} == "yes" ]] ; then
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
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
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
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
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
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
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
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
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
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
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
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
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
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
package_help() {
- package_print_first
-
echo -e "${c_title}${public_name}${c_reset}"
echo -e " ${c_notice}Version ${version}${c_reset}"
echo
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() {
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
fi
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- package_print_first_or_always
-
+ echo
echo "Cleaned '${path_destination}individual'."
fi
fi
fi
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- package_print_first_or_always
-
+ echo
echo "Cleaned '${path_destination}level'."
fi
fi
fi
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- package_print_first_or_always
-
+ echo
echo "Cleaned '${path_destination}monolithic'."
fi
fi
fi
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- package_print_first_or_always
-
+ echo
echo "Cleaned '${path_destination}program'."
fi
fi
fi
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- package_print_first_or_always
-
+ echo
echo "Cleaned '${path_destination}stand_alone/${prepend}${i}-${version}/'."
fi
done
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
}
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"
p=
fi
- if [[ ${verbosity} == "quiet" ]] ; then
- print_line_first="no"
- print_line_last="no"
- fi
-
test_handle_colors
if [[ ${do_help} == "yes" ]] ; then
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
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
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
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
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
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
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
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
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
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
test_help() {
- test_print_first
-
echo -e "${c_title}${public_name}${c_reset}"
echo -e " ${c_notice}Version ${version}${c_reset}"
echo
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() {
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
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
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
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
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
fi
if [[ ${verbosity} == "debug" ]] ; then
- test_print_first_or_always
-
echo -e "Running '${c_notice}cd ${path_}${project}-${version}/${c_reset}'."
fi
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
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
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
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
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
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
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
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
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
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
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
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
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
fi
if [[ ${verbosity} == "debug" ]] ; then
- test_print_first_or_always
-
echo "mkdir ${verbose_common} -p ${cmocka_data}"
fi
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
fi
if [[ ${verbosity} == "debug" ]] ; then
- test_print_first_or_always
-
echo "cp ${verbose_common} ${cmocka_settings} ${cmocka_data}"
fi
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
fi
if [[ ${verbosity} == "debug" ]] ; then
- test_print_first_or_always
-
echo "cd ${cmocka_path}"
fi
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
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
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
fi
if [[ ${verbosity} == "debug" ]] ; then
- test_print_first_or_always
-
echo "cp ${verbose_common} -R ${cmocka_build}includes/* ${work_path}includes/"
fi
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
fi
if [[ ${verbosity} == "debug" ]] ; then
- test_print_first_or_always
-
echo "cp ${verbose_common} -R ${cmocka_build}libraries/shared/* ${work_path}libraries/shared/"
fi
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
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
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
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
fi
if [[ ${verbosity} == "debug" ]] ; then
- test_print_first_or_always
-
echo "cd ${libcap_path}"
fi
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
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
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
if [[ ${failure} -eq 0 ]] ; then
if [[ ${verbosity} == "debug" ]] ; then
- test_print_first_or_always
-
echo -e "Running '${c_notice}cd ${destination}${c_reset}'."
fi
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
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
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
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
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
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
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
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
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
}