summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-04-29 12:01:13 +0100
committerLeah Rowe <leah@libreboot.org>2025-04-29 12:01:13 +0100
commit093a86d9c09295e79a7e8f271c9f05dd91a85e4b (patch)
treeb3daf65637be80739513e4fedcd625dbbf305e62
parent3045079947be1f88c76badcfa0df99e96097fb44 (diff)
init.sh: don't use eval to read version files
it's not necessary, and was the cause of a recent issue, which i mitigated, but why mitigate it? prevent bugs. don't use eval unless absolutely necessary. Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/init.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/init.sh b/include/init.sh
index b515cebc..09b3223b 100644
--- a/include/init.sh
+++ b/include/init.sh
@@ -161,9 +161,8 @@ xbmk_set_env()
xbmk_set_version()
{
- for fv in version versiondate; do
- eval "[ ! -f \"\.$fv\" ] || read -r $fv < \"\.$fv\" || :"
- done
+ [ ! -f ".version" ] || read -r version < ".version" || :; :
+ [ ! -f ".versiondate" ] || read -r versiondate < ".versiondate" || :; :
[ -e ".git" ] || [ -f ".version" ] || printf "unknown\n" > ".version" \
|| $err "Cannot generate unknown .version file"