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}"
+
+