Cleaned up build summary a bit

This commit is contained in:
T. Joseph Carter 2015-02-20 20:57:20 -08:00
parent 2b5840f309
commit 69ce77888d

View File

@ -40,9 +40,9 @@ RESET_FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET_ALT
build_summary_log() { build_summary_log() {
if [ "$1" -eq "0" ]; then if [ "$1" -eq "0" ]; then
printf -v build_success "%s%s\n" "$build_success" "$2" build_success="$build_success$2 "
else else
printf -v build_fail "%s%s\n" "$build_fail" "$2" build_fail="$build_fail$2 "
fi fi
} }
@ -708,18 +708,25 @@ build_libretro_mupen64() {
build_summary() { build_summary() {
if [ -z "$NOBUILD_SUMMARY" ]; then if [ -z "$NOBUILD_SUMMARY" ]; then
if command -v fmt > /dev/null; then
use_fmt=1
fi
printf -v summary "=== Core Build Summary ===\n\n" printf -v summary "=== Core Build Summary ===\n\n"
if [ -n "$build_success" ]; then if [ -n "$build_success" ]; then
printf -v summary "%s%s\n" "$summary" "$(echo $build_success | wc -w) core(s) successfully built:" printf -v summary "%s%d %s\n" "$summary" "$(echo $build_success | wc -w)" "core(s) successfully built:"
printf -v summary "%s%s\n\n" "$summary" "$(echo $build_success)" if [ -n "$use_fmt" ]; then
else printf -v summary "%s%s\n\n" "$summary" "$(echo " $build_success" | fmt)"
printf -v summary "%s%s\n\n" "$summary" " 0 cores successfully built." else
printf -v summary "%s%s\n\n" "$summary" "$(echo $build_success)"
fi
fi fi
if [ -n "$build_fail" ]; then if [ -n "$build_fail" ]; then
printf -v summary "%s%s\n" "$summary" "$(echo $build_fail | wc -w) core(s) failed to build:" printf -v summary "%s%d %s\n" "$summary" "$(echo $build_fail | wc -w)" "core(s) failed to build:"
printf -v summary "%s%s\n\n" "$summary" "$(echo $build_fail)" if [ -n "$use_fmt" ]; then
else printf -v summary "%s%s\n\n" "$summary" "$(echo " $build_fail" | fmt)"
printf -v summary "%s%s\n\n" "$summary" " 0 cores failed to build!" else
printf -v summary "%s%s\n\n" "$summary" "$(echo $build_fail)"
fi
fi fi
if [[ -z "$build_success" && -z "$build_fail" ]]; then if [[ -z "$build_success" && -z "$build_fail" ]]; then
printf -v summary "%s%s\n\n" "$summary" "No build actions performed." printf -v summary "%s%s\n\n" "$summary" "No build actions performed."