mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 14:02:52 +02:00
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>
This commit is contained in:
+2
-3
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user