From ecf9f4f88a50d226cc53f4802401bcc169993e7c Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Fri, 28 Aug 2020 17:59:17 +0000 Subject: [PATCH 1/2] build-tools.sh: fix minor shellcheck warnings Missing quotes mostly, also some disable=SC2034 because "eval". Signed-off-by: Marc Herbert --- scripts/build-tools.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/build-tools.sh b/scripts/build-tools.sh index a8302f24ba0c..ef9cb0e13b9f 100755 --- a/scripts/build-tools.sh +++ b/scripts/build-tools.sh @@ -39,6 +39,7 @@ make_tool() # if no argument provided, all the tools will be built. Empty tool is # okay. tool=$1 + # shellcheck disable=SC2086 make -C "$BUILD_TOOLS_DIR" -j "$NO_PROCESSORS" $tool } @@ -69,7 +70,7 @@ main() SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) SOF_REPO=$(dirname "$SCRIPT_DIR") BUILD_TOOLS_DIR="$SOF_REPO"/tools/build_tools - : ${NO_PROCESSORS:=$(nproc)} + : "${NO_PROCESSORS:=$(nproc)}" BUILD_ALL=false if [ $# -eq 0 ]; then @@ -84,6 +85,8 @@ main() DO_BUILD_topologies=false CMAKE_ONLY=false + # eval is a sometimes necessary evil + # shellcheck disable=SC2034 while getopts "cfhlptTC" OPTION; do case "$OPTION" in c) DO_BUILD_ctl=true ;; @@ -97,7 +100,7 @@ main() *) print_usage; exit 1;; esac done - shift "$(($OPTIND - 1))" + shift "$((OPTIND - 1))" reconfigure_build if "$CMAKE_ONLY"; then From 8e17af818384f433abc21e88a9cb70d6ed2720b4 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Fri, 28 Aug 2020 18:02:03 +0000 Subject: [PATCH 2/2] build-tools.sh: fix misnamed locals DO_BUILD_topology and _test Easier to spot once all other shellcheck warnings have been fixed. Signed-off-by: Marc Herbert --- scripts/build-tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-tools.sh b/scripts/build-tools.sh index ef9cb0e13b9f..369f45d0b7e3 100755 --- a/scripts/build-tools.sh +++ b/scripts/build-tools.sh @@ -65,7 +65,7 @@ EOFUSAGE main() { local DO_BUILD_ctl DO_BUILD_fuzzer DO_BUILD_logger DO_BUILD_probes \ - DO_BUILD_test DO_BUILD_topology SCRIPT_DIR SOF_REPO CMAKE_ONLY \ + DO_BUILD_tests DO_BUILD_topologies SCRIPT_DIR SOF_REPO CMAKE_ONLY \ BUILD_ALL SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) SOF_REPO=$(dirname "$SCRIPT_DIR")