From e3f817aef5ff841af18d02a26324528d7680b856 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 29 Nov 2023 08:38:11 +0100 Subject: [PATCH] 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. --- build_sysext | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build_sysext b/build_sysext index 95bc35c569..954f8790df 100755 --- a/build_sysext +++ b/build_sysext @@ -83,6 +83,10 @@ FLAGS "$@" || exit 1 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 SYSEXTNAME="${1:-}" @@ -129,8 +133,6 @@ _get_sysext_arch() { fi } -set -euo pipefail - cleanup() { local dirs=( "${BUILD_DIR}/fs-root"