From 7f8d85140fd229e97e539ca463fbd94545997fd6 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 4 Oct 2025 05:23:47 +0100 Subject: xbmk: remove the setcfg function this allows me to remove several eval calls, and the errors relating to configs can now show exactly which function they occured in, allowing for easier debugging. once again, eval should be used sparingly if at all. Signed-off-by: Leah Rowe --- include/inject.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include/inject.sh') diff --git a/include/inject.sh b/include/inject.sh index ac5739c6..9f30b0a0 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -115,7 +115,9 @@ check_target() boarddir="$cbcfgsdir/$board" - eval "`setcfg "$boarddir/target.cfg"`" + . "$boarddir/target.cfg" || \ + err "Can't read '$boarddir/target.cfg'" "check_target" "$@" + chkvars tree x_ ./mk -d coreboot "$tree" @@ -160,7 +162,13 @@ readkconfig() x_ rm -f "$xbtmp/cbcfg" fx_ scankconfig x_ find "$boarddir/config" -type f - eval "`setcfg "$xbtmp/cbcfg" 1`" + + if e "$xbtmp/cbcfg" f missing; then + return 1 + fi + + . "$xbtmp/cbcfg" || \ + err "Can't read '$xbtmp/cbcfg'" "readkconfig" "$@" if ! setvfile "$@"; then return 1 -- cgit v1.2.1