build_sysext: Use strict mode

Using strict mode install a trap handler that prints backtraces in
case of errors. This will be useful to print some additional debugging
information.
This commit is contained in:
Krzesimir Nowak 2023-11-29 08:38:11 +01:00
parent 230020c64a
commit e3f817aef5

View File

@ -83,6 +83,10 @@ FLAGS "$@" || exit 1
eval set -- "${FLAGS_ARGV}" eval set -- "${FLAGS_ARGV}"
# Only now can we die on error. shflags functions leak non-zero error codes,
# so will die prematurely if 'switch_to_strict_mode' is specified before now.
switch_to_strict_mode -uo pipefail
# Validate command line parameters # Validate command line parameters
SYSEXTNAME="${1:-}" SYSEXTNAME="${1:-}"
@ -129,8 +133,6 @@ _get_sysext_arch() {
fi fi
} }
set -euo pipefail
cleanup() { cleanup() {
local dirs=( local dirs=(
"${BUILD_DIR}/fs-root" "${BUILD_DIR}/fs-root"