xbmk: remove even more eval statements

in one or two cases, the use of eval is retained, but
modified so as to be safer.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-10-04 06:13:15 +01:00
parent 7f8d85140f
commit 4f01dc704a
7 changed files with 249 additions and 59 deletions
+61 -9
View File
@@ -4,11 +4,48 @@
# Copyright (c) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
# Copyright (c) 2023-2025 Leah Rowe <leah@libreboot.org>
eval "`setvars "" xarch srcdir premake gnatdir xlang mode makeargs elfdir cmd \
project target target_dir targets xtree _f release bootstrapargs mkhelper \
autoconfargs listfile autogenargs btype rev build_depend gccdir cmakedir \
defconfig postmake mkhelpercfg dry dest_dir mdir cleanargs gccver gccfull \
gnatver gnatfull do_make badhash badtghash tree forcepull`"
xarch=""
srcdir=""
premake=""
gnatdir=""
xlang=""
mode=""
makeargs=""
elfdir=""
cmd=""
project=""
target=""
target_dir=""
targets=""
xtree=""
_f=""
release=""
bootstrapargs=""
mkhelper=""
autoconfargs=""
listfile=""
autogenargs=""
btype=""
rev=""
build_depend=""
gccdir=""
cmakedir=""
defconfig=""
postmake=""
mkhelpercfg=""
dry=""
dest_dir=""
mdir=""
cleanargs=""
gccver=""
gccfull=""
gnatver=""
gnatfull=""
do_make=""
badhash=""
badtghash=""
tree=""
forcepull=""
trees()
{
@@ -172,7 +209,10 @@ handle_defconfig()
return 0
fi
chkvars tree
if [ -z "$tree" ]; then
err "$configdir: 'tree' not set" "handle_defconfig" "$@"
fi
srcdir="src/$project/$tree"
if [ "$mode" = "${mode%clean}" ] && [ ! -d "$srcdir" ]; then
@@ -209,9 +249,21 @@ handle_defconfig()
configure_project()
{
eval "`setvars "" cleanargs build_depend autoconfargs xtree postmake \
makeargs btype mkhelper bootstrapargs premake release xlang xarch \
badhash badtghash`"
cleanargs=""
build_depend=""
autoconfargs=""
xtree=""
postmake=""
makeargs=""
btype=""
mkhelper=""
bootstrapargs=""
premake=""
release=""
xlang=""
xarch=""
badhash=""
badtghash=""
_tcfg="$1/target.cfg"