Quote expansions in firmware_size() of bin/kaleidoscope-builder. I left

line 35 (the "output" variable) alone. Issue #299.
pull/305/head
Chris King-Parra 7 years ago committed by Gergely Nagy
parent bc5abd63ab
commit 03bdc34001

@ -24,8 +24,8 @@ build_filenames () {
firmware_size () { firmware_size () {
if [ "${BOARD}" = "virtual" ]; then if [ "${BOARD}" = "virtual" ]; then
echo "[Size not computed for virtual build]" echo "[Size not computed for virtual build]"
return return
fi fi
## This is a terrible hack, please don't hurt me. - algernon ## This is a terrible hack, please don't hurt me. - algernon
@ -34,9 +34,9 @@ firmware_size () {
output="$($@ | grep "\\(Program\\|Data\\):" | sed -e 's,^, - ,' && echo)" output="$($@ | grep "\\(Program\\|Data\\):" | sed -e 's,^, - ,' && echo)"
PROGSIZE="$(echo "${output}" | grep Program: | cut -d: -f2 | awk '{print $1}')" PROGSIZE="$(echo "${output}" | grep "Program:" | cut -d: -f2 | awk '{print $1}')"
PERCENT="$(echo ${PROGSIZE} ${MAX_PROG_SIZE} | awk "{ printf \"%02.01f\", \$1 / \$2 * 100 }")" PERCENT="$(echo "${PROGSIZE}" "${MAX_PROG_SIZE}" | awk "{ printf \"%02.01f\", \$1 / \$2 * 100 }")"
echo "${output}" | sed -e "s/\(Program:.*\)(\([0-9\.]*%\) Full)/\1(${PERCENT}% Full)/" echo "${output}" | sed -e "s/\(Program:.*\)(\([0-9\.]*%\) Full)/\1(${PERCENT}% Full)/"
} }

Loading…
Cancel
Save