mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 14:11:07 +02:00
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:
parent
021858a82f
commit
df2a1e2bd4
@ -81,7 +81,7 @@ finish_job() {
|
|||||||
# can throw an error; doesn't matter, thus this form.
|
# can throw an error; doesn't matter, thus this form.
|
||||||
! wait ${finished} &> /dev/null
|
! wait ${finished} &> /dev/null
|
||||||
if [ "${result-1}" -ne "0" ]; then
|
if [ "${result-1}" -ne "0" ]; then
|
||||||
(( ERROR_COUNT++ ))
|
: $(( ++ERROR_COUNT ))
|
||||||
fi
|
fi
|
||||||
# Bit of a hack, but it works well enough.
|
# Bit of a hack, but it works well enough.
|
||||||
debug "finished ${finished} with result ${result-1}"
|
debug "finished ${finished} with result ${result-1}"
|
||||||
@ -173,7 +173,7 @@ dump_file() {
|
|||||||
if ! cmp --quiet "${installed_sym}" "${SYM_FILE}"; then
|
if ! cmp --quiet "${installed_sym}" "${SYM_FILE}"; then
|
||||||
error "${installed_sym} differ from current sym file:"
|
error "${installed_sym} differ from current sym file:"
|
||||||
error "$(diff "${installed_sym}" "${SYM_FILE}")"
|
error "$(diff "${installed_sym}" "${SYM_FILE}")"
|
||||||
(( ERROR_COUNT++ ))
|
: $(( ++ERROR_COUNT ))
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -266,7 +266,7 @@ main() {
|
|||||||
either_file=${either_file%\'}
|
either_file=${either_file%\'}
|
||||||
if [ ! -h "${either_file}" -a ! -f "${either_file}" ]; then
|
if [ ! -h "${either_file}" -a ! -f "${either_file}" ]; then
|
||||||
error "Specified file ${either_file} does not exist"
|
error "Specified file ${either_file} does not exist"
|
||||||
(( ERROR_COUNT++ ))
|
: $(( ++ERROR_COUNT ))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [ "${either_file##*.}" == "debug" ]; then
|
if [ "${either_file##*.}" == "debug" ]; then
|
||||||
@ -290,7 +290,7 @@ main() {
|
|||||||
if [[ ${ERROR_COUNT} == 0 ]]; then
|
if [[ ${ERROR_COUNT} == 0 ]]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
die "Encountered ${ERROR_COUNT} problems"
|
die_notrace "Encountered ${ERROR_COUNT} problems"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user