From 304b0995342d7b77b3817f74f864633d09e9e7a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 8 Jun 2020 10:59:41 +0200 Subject: [PATCH] all.sh: clean up some uses of "local" variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While pure sh doesn't have a concept of local variables, we can partially emulate them by unsetting variables before we exit the function, and use the convention of giving them lowercase names to distinguish from global variables. Signed-off-by: Manuel Pégourié-Gonnard --- tests/scripts/all.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index f2b346359f..32efc1d1f0 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -682,11 +682,12 @@ component_check_names () { component_check_test_cases () { msg "Check: test case descriptions" # < 1s if [ $QUIET -eq 1 ]; then - OPT='--quiet' + opt='--quiet' else - OPT='' + opt='' fi - record_status tests/scripts/check-test-cases.py $OPT + record_status tests/scripts/check-test-cases.py $opt + unset opt } component_check_doxygen_warnings () { @@ -1942,7 +1943,7 @@ run_component () { # Restore the build tree to a clean state. cleanup - current_component="" + unset current_component } # Preliminary setup