commit | 2bfce82fe143f40024be0c897c6833ef74134992 | [log] [tgz] |
---|---|---|
author | Anil Altinay <aaltinay@google.com> | Wed Aug 11 21:32:14 2021 +0000 |
committer | Anil Altinay <aaltinay@google.com> | Thu Aug 12 00:56:39 2021 +0000 |
tree | 8004e2d07cacae888450d40844eb72642e888d76 | |
parent | 637e07f9d7df0a375b3b87d61ad5d79a0f6caaa7 [diff] |
project-lakitu: Improve the error handling in configure script BUG=b/196257748 TEST=presubmit and tested with a failing bash script RELEASE_NOTE=None Change-Id: Ic32a746dc2efdbd601866aef3c77dc37e4162c49 Reviewed-on: https://cos-review.googlesource.com/c/cos/overlays/board-overlays/+/20999 Reviewed-by: Vaibhav Rustagi <vaibhavrustagi@google.com> Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
diff --git a/project-lakitu/app-admin/cos-alphabet-compliance/cos-alphabet-compliance-0.0.1-r2.ebuild b/project-lakitu/app-admin/cos-alphabet-compliance/cos-alphabet-compliance-0.0.1-r3.ebuild similarity index 100% rename from project-lakitu/app-admin/cos-alphabet-compliance/cos-alphabet-compliance-0.0.1-r2.ebuild rename to project-lakitu/app-admin/cos-alphabet-compliance/cos-alphabet-compliance-0.0.1-r3.ebuild
diff --git a/project-lakitu/app-admin/cos-alphabet-compliance/files/configure.sh b/project-lakitu/app-admin/cos-alphabet-compliance/files/configure.sh index 990d85a..9733c9a 100644 --- a/project-lakitu/app-admin/cos-alphabet-compliance/files/configure.sh +++ b/project-lakitu/app-admin/cos-alphabet-compliance/files/configure.sh
@@ -16,7 +16,17 @@ # Runs all of the alphabet compliance scripts in {SCRIPTS_DIR}. SCRIPTS_DIR=/usr/share/google/security/experimental/alphabet-compliance/scripts +exit_code=0 -for script in $(ls -v "${SCRIPTS_DIR}"/[0-9][0-9][0-9][0-9]-*.sh) ; do - . ${script} || echo "Error occured while executing ${script}" +for script in "${SCRIPTS_DIR}"/[0-9][0-9][0-9][0-9]-*.sh ; do + . "${script}" + ret_code=$? + if [ "${ret_code}" -ne 0 ]; then + exit_code="${ret_code}" + echo "Error code: ${ret_code} returned while executing ${script}" + fi done + +exit "${exit_code}" + +