Make my build summary work without using files (we lose pretty formatting for now)

This commit is contained in:
T. Joseph Carter 2015-02-17 12:03:38 -08:00
parent 44ce1675fc
commit 4955cee0cc
2 changed files with 21 additions and 31 deletions

View File

@ -37,12 +37,10 @@ RESET_FORMAT_COMPILER_TARGET=$FORMAT_COMPILER_TARGET
RESET_FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET_ALT RESET_FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET_ALT
build_summary_log() { build_summary_log() {
if [ -n "${BUILD_SUMMARY}" ]; then if [ "$1" -eq "0" ]; then
if [ "${1}" -eq "0" ]; then printf -v build_success "%s%s\n" "$build_success" "$2"
echo ${2} >> ${BUILD_SUCCESS} else
else printf -v build_fail "%s%s\n" "$build_fail" "$2"
echo ${2} >> ${BUILD_FAIL}
fi
fi fi
} }
@ -641,23 +639,24 @@ build_libretro_mupen64() {
} }
build_summary() { build_summary() {
if [ -z "${NOBUILD_SUMMARY}" ]; then if [ -z "$NOBUILD_SUMMARY" ]; then
echo "=== Core Build Summary ===" > ${BUILD_SUMMARY} printf -v summary "=== Core Build Summary ===\n\n"
if [ -r "${BUILD_SUCCESS}" ]; then if [ -n "$build_success" ]; then
echo "`wc -l < ${BUILD_SUCCESS}` core(s) successfully built:" >> ${BUILD_SUMMARY} printf -v summary "%s%s\n" "$summary" "$(echo $build_success | wc -w) core(s) successfully built:"
${BUILD_SUMMARY_FMT} ${BUILD_SUCCESS} >> ${BUILD_SUMMARY} printf -v summary "%s%s\n\n" "$summary" "$(echo $build_success)"
else else
echo " 0 cores successfully built. :(" >> ${BUILD_SUMMARY} printf -v summary "%s%s\n\n" "$summary" " 0 cores successfully built. :("
echo "`wc -l < ${BUILD_FAIL}` core(s) failed to build:"
fi fi
if [ -r "${BUILD_FAIL}" ]; then if [ -n "$build_fail" ]; then
echo "`wc -l < ${BUILD_FAIL}` core(s) failed to build:" >> ${BUILD_SUMMARY} printf -v summary "%s%s\n" "$summary" "$(echo $build_fail | wc -w) core(s) failed to build:"
${BUILD_SUMMARY_FMT} ${BUILD_FAIL} >> ${BUILD_SUMMARY} printf -v summary "%s%s\n\n" "$summary" "$(echo $build_fail)"
else else
echo " 0 cores failed to build! :D" >> ${BUILD_SUMMARY} printf -v summary "%s%s\n\n" "$summary" " 0 cores failed to build! :D"
fi fi
rm -f $BUILD_SUCCESS $BUILD_FAIL if [ -n "$BUILD_SUMMARY" ]; then
cat ${BUILD_SUMMARY} echo "$summary" > "$BUILD_SUMMARY"
fi
echo "$summary"
fi fi
} }

View File

@ -194,19 +194,10 @@ fi
#CORE BUILD SUMMARY #CORE BUILD SUMMARY
#================== #==================
# Remove this to enable the core build summary # Uncomment this to disable the core build summary
export BUILD_SUMMARY=1 # NOBUILD_SUMMARY=1
BUILD_SUMMARY=${WORKDIR}/build-summary.log BUILD_SUMMARY="$WORKDIR/build-summary.log"
BUILD_SUCCESS=${WORKDIR}/build-success.log
BUILD_FAIL=${WORKDIR}/build-fail.log
if [ -z "${BUILD_SUMMARY_FMT}" ]; then
if command -v column >/dev/null; then
BUILD_SUMMARY_FMT=column
else
BUILD_SUMMARY_FMT=cat
fi
fi
#USER DEFINES #USER DEFINES