mirror of
https://codeberg.org/canoeboot/cbmk.git
synced 2025-07-28 00:12:25 +01: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:
parent
b63612871d
commit
34d134f2f2
1 changed files with 2 additions and 3 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue