From b6f7e4bcaf1cd8037eca417c6ca5bc829e9d42f8 Mon Sep 17 00:00:00 2001
From: Grische <github@grische.xyz>
Date: Mon, 1 Jul 2024 22:30:32 +0200
Subject: [PATCH] scripts: module-check: replace eval with indirection

---
 scripts/module_check.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/module_check.sh b/scripts/module_check.sh
index 977398a2c..8199f49ca 100755
--- a/scripts/module_check.sh
+++ b/scripts/module_check.sh
@@ -1,5 +1,4 @@
 #!/bin/bash
-# shellcheck disable=SC2154
 
 set -e
 
@@ -15,8 +14,10 @@ fi
 need_sync=false
 
 for module in $GLUON_MODULES; do
-	var=$(echo "$module" | tr '[:lower:]/' '[:upper:]_')
-	eval 'commit_expected=${'"${var}"'_COMMIT}'
+	echo "Checking module '$module'"
+	var=${module//\//_}
+	_remote_commit=${var^^}_COMMIT
+	commit_expected=${!_remote_commit}
 
 	prefix=invalid
 	cd "$GLUONDIR/$module" 2>/dev/null && prefix="$(git rev-parse --show-prefix 2>/dev/null)"
-- 
GitLab