gnuboot-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 12/22] release: tests: make it pass shellcheck.


From: Denis 'GNUtoo' Carikli
Subject: [PATCH v1 12/22] release: tests: make it pass shellcheck.
Date: Fri, 20 Dec 2024 22:24:07 +0100

Without this fix, running shellcheck -x on
resources/packages/release/test shows the following error:
    In resources/packages/release/test line 200:
    missing_in_release_files=$(expr $missing_in_release_files + 1)
                                       ^--^ SC2003 (style): expr is antiquated.
    Consider rewriting this using $((..)), ${} or [[ ]].
                                            ^-----------------------^ SC2086
    (info): Double quote to prevent globbing and word splitting.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
 resources/packages/release/test | 2 +-
 tests/lint                      | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/resources/packages/release/test b/resources/packages/release/test
index 63d3f5af..35ecedb7 100755
--- a/resources/packages/release/test
+++ b/resources/packages/release/test
@@ -197,7 +197,7 @@ test_release_dir()
 
         if [ $found -eq 0 ] ; then
             echo "[ !! ] $path missing in \${release_files}"
-            missing_in_release_files=$(expr $missing_in_release_files + 1)
+            missing_in_release_files="$((missing_in_release_files + 1))"
         fi
     done < <(find "${dir}" -type f -print0)
 
diff --git a/tests/lint b/tests/lint
index 2f81b8aa..6e68cfb9 100755
--- a/tests/lint
+++ b/tests/lint
@@ -57,6 +57,7 @@ run_shellcheck \
     resources/packages/ich9utils/distclean \
     resources/packages/memtest86plus/distclean \
     resources/packages/payloads/distclean \
+    resources/packages/release/test \
     resources/packages/rom_images/distclean \
     resources/packages/roms/distclean \
     resources/packages/roms/download \
-- 
2.46.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]