scripts: Fix possible cause of cros_generate_breakpad_symbols crash

Use the ":" builtin command to prevent the increment of $ERROR_COUNT from
ever failing under strict mode (i.e. "set -e").
cros_generate_breakpad_symbols failed for some reason, and this is my best
guess as to the cause.  That is, the post-increment would otherwise fail
when $ERROR_COUNT is zero because it would have a non-zero exit status.

BUG=chromium-os:31332
TEST=Manually ran script

Change-Id: Iec7fd9358c339414ccd3c2ca1fd598f124375f0b
Reviewed-on: https://gerrit.chromium.org/gerrit/23979
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
This commit is contained in:
Michael Krebs 2012-05-29 18:57:51 -07:00 committed by Gerrit
parent 021858a82f
commit df2a1e2bd4

View File

@ -81,7 +81,7 @@ finish_job() {
# can throw an error; doesn't matter, thus this form.
! wait ${finished} &> /dev/null
if [ "${result-1}" -ne "0" ]; then
(( ERROR_COUNT++ ))
: $(( ++ERROR_COUNT ))
fi
# Bit of a hack, but it works well enough.
debug "finished ${finished} with result ${result-1}"
@ -173,7 +173,7 @@ dump_file() {
if ! cmp --quiet "${installed_sym}" "${SYM_FILE}"; then
error "${installed_sym} differ from current sym file:"
error "$(diff "${installed_sym}" "${SYM_FILE}")"
(( ERROR_COUNT++ ))
: $(( ++ERROR_COUNT ))
exit 1
fi
fi
@ -266,7 +266,7 @@ main() {
either_file=${either_file%\'}
if [ ! -h "${either_file}" -a ! -f "${either_file}" ]; then
error "Specified file ${either_file} does not exist"
(( ERROR_COUNT++ ))
: $(( ++ERROR_COUNT ))
continue
fi
if [ "${either_file##*.}" == "debug" ]; then
@ -290,7 +290,7 @@ main() {
if [[ ${ERROR_COUNT} == 0 ]]; then
return 0
fi
die "Encountered ${ERROR_COUNT} problems"
die_notrace "Encountered ${ERROR_COUNT} problems"
}
main "$@"