From 5d221de68c757c2af3f61b0d47d809256a454539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 9 Oct 2024 11:20:06 +0200 Subject: [PATCH] all.sh: move top-level code to a function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now the output of grep '^[^ {}#]' tests/scripts/all-*.sh | grep -v '()' is clean, with the only results being: - shopt -s extglob which is needing for parsing the rest - usage message Signed-off-by: Manuel Pégourié-Gonnard --- tests/scripts/all-core.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/scripts/all-core.sh b/tests/scripts/all-core.sh index 0e0a4a2d96..8b3fcce362 100644 --- a/tests/scripts/all-core.sh +++ b/tests/scripts/all-core.sh @@ -433,9 +433,11 @@ fatal_signal () { kill -$1 $$ } -trap 'fatal_signal HUP' HUP -trap 'fatal_signal INT' INT -trap 'fatal_signal TERM' TERM +pre_set_signal_handlers () { + trap 'fatal_signal HUP' HUP + trap 'fatal_signal INT' INT + trap 'fatal_signal TERM' TERM +} # Number of processors on this machine. Used as the default setting # for parallel make. @@ -979,6 +981,7 @@ run_component () { main () { # Preliminary setup pre_set_shell_options + pre_set_signal_handlers pre_check_environment pre_load_helpers pre_load_components