From f7114b7fe38861f1dc618586158617f9b1c14ddd Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Tue, 13 Feb 2024 13:38:57 -0600 Subject: [PATCH] cocci/run-check: log if parallel command is not found If CONCURRENCY_LEVEL was set, the script would log a concurrency level even if the parallel command was not available. Not log if parallel is not available and set concurrency to 1. --- qa/coccinelle/run_check.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qa/coccinelle/run_check.sh b/qa/coccinelle/run_check.sh index 325e1732fa..d9a451661b 100755 --- a/qa/coccinelle/run_check.sh +++ b/qa/coccinelle/run_check.sh @@ -29,9 +29,12 @@ else BUILT_COCCI_FILES="" fi -if [ -z "$CONCURRENCY_LEVEL" ]; then +if ! command -v parallel > /dev/null; then + echo "Concurrency disabled, command 'parallel' not available" + CONCURRENCY_LEVEL=1 +elif [ -z "$CONCURRENCY_LEVEL" ]; then + echo "No concurrency" CONCURRENCY_LEVEL=1 - echo "No concurrency" else echo "Using concurrency level $CONCURRENCY_LEVEL" fi