]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
cocci/run-check: log if parallel command is not found 10445/head
authorJason Ish <jason.ish@oisf.net>
Tue, 13 Feb 2024 19:38:57 +0000 (13:38 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 15 Feb 2024 18:27:48 +0000 (19:27 +0100)
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

index 325e1732fa5ad8026ec582ba678583eb7f1c0d18..d9a451661b93fc3c54b41606432378fa101870ff 100755 (executable)
@@ -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