use backticks on eval commands, not subshells

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2
Leah Rowe 2024-06-22 04:06:07 +01:00 committed by Leah Rowe
parent e7fcfac14e
commit ad1d0cb58c
5 changed files with 22 additions and 21 deletions

4
build
View File

@ -14,7 +14,7 @@ fi
. "include/lib.sh" . "include/lib.sh"
eval "$(setvars "" vdir src_dirname srcdir _xm mode xp)" eval `setvars "" vdir src_dirname srcdir _xm mode xp`
err="fail" err="fail"
main() main()
@ -40,7 +40,7 @@ git_init()
{ {
[ -L ".git" ] && return 1 [ -L ".git" ] && return 1
[ -e ".git" ] && return 0 [ -e ".git" ] && return 0
eval "$(setvars "$(date -Rud @$versiondate)" cdate _nogit)" eval `setvars "$(date -Rud @$versiondate)" cdate _nogit`
git init || return 1 git init || return 1
git add -A . || return 1 git add -A . || return 1

View File

@ -2,8 +2,8 @@
# Copyright (c) 2020-2021,2023-2024 Leah Rowe <leah@libreboot.org> # Copyright (c) 2020-2021,2023-2024 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com> # Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
eval "$(setvars "" _target rev _xm loc url bkup_url depend tree_depend xtree \ eval `setvars "" _target rev _xm loc url bkup_url depend tree_depend xtree \
mdir subhash subrepo subrepo_bkup subfile subfile_bkup)" mdir subhash subrepo subrepo_bkup subfile subfile_bkup`
fetch_project_trees() fetch_project_trees()
{ {
@ -17,9 +17,9 @@ fetch_project_trees()
fetch_config() fetch_config()
{ {
rm -f "$cfgsdir/"*/seen || $err "fetch_config $cfgsdir: !rm seen" rm -f "$cfgsdir/"*/seen || $err "fetch_config $cfgsdir: !rm seen"
eval "$(setvars "" xtree tree_depend)" eval `setvars "" xtree tree_depend`
while true; do while true; do
eval "$(setvars "" rev tree)" eval `setvars "" rev tree`
_xm="fetch_config $project/$_target" _xm="fetch_config $project/$_target"
load_target_config "$_target" load_target_config "$_target"
[ "$_target" = "$tree" ] && break [ "$_target" = "$tree" ] && break
@ -47,7 +47,7 @@ prepare_new_tree()
fetch_project_repo() fetch_project_repo()
{ {
eval "$(setvars "" xtree tree_depend)" eval `setvars "" xtree tree_depend`
eval `setcfg "config/git/$project/pkg.cfg"` eval `setcfg "config/git/$project/pkg.cfg"`
chkvars url chkvars url
@ -111,7 +111,7 @@ prep_submodules()
fetch_submodule() fetch_submodule()
{ {
mcfgdir="$mdir/${1##*/}" mcfgdir="$mdir/${1##*/}"
eval $(setvars "" subhash subrepo subrepo_bkup subfile subfile_bkup st) eval `setvars "" subhash subrepo subrepo_bkup subfile subfile_bkup st`
[ ! -f "$mcfgdir/module.cfg" ] || . "$mcfgdir/module.cfg" || \ [ ! -f "$mcfgdir/module.cfg" ] || . "$mcfgdir/module.cfg" || \
$err "! . $mcfgdir/module.cfg" $err "! . $mcfgdir/module.cfg"

View File

@ -42,8 +42,8 @@ chkvars()
done done
} }
eval "$(setvars "" xbmk_release tmpdir _nogit version board boarddir relname \ eval `setvars "" xbmk_release tmpdir _nogit version board boarddir relname \
versiondate threads projectname projectsite aur_notice cfgsdir datadir)" versiondate threads projectname projectsite aur_notice cfgsdir datadir`
read -r projectname < projectname || : read -r projectname < projectname || :
read -r projectsite < projectsite || : read -r projectsite < projectsite || :

View File

@ -26,8 +26,8 @@ pv="payload_uboot payload_grub_withseabios payload_seabios payload_memtest t"
pv="$pv payload_seabios_withgrub payload_seabios_grubonly payload_grub" pv="$pv payload_seabios_withgrub payload_seabios_grubonly payload_grub"
v="romdir cbrom initmode displaymode cbcfg targetdir tree release ubootelf" v="romdir cbrom initmode displaymode cbcfg targetdir tree release ubootelf"
v="$v grub_timeout board grub_scan_disk uboot_config grubtree grubelf tmpmv" v="$v grub_timeout board grub_scan_disk uboot_config grubtree grubelf tmpmv"
eval "$(setvars "n" $pv)" eval `setvars "n" $pv`
eval "$(setvars "" $v boards targets serdir ser)" eval `setvars "" $v boards targets serdir ser`
main() main()
{ {
@ -88,7 +88,8 @@ serlist()
configure_target() configure_target()
{ {
eval "$(setvars "n" $pv) $(setvars "" $v)" eval `setvars "n" $pv`
eval `setvars "" $v`
board="$1" board="$1"
targetdir="$cfgsdir/$board" targetdir="$cfgsdir/$board"
@ -106,11 +107,11 @@ configure_target()
[ "$payload_memtest" != "y" ] && payload_memtest="n" [ "$payload_memtest" != "y" ] && payload_memtest="n"
[ "$(uname -m)" = "x86_64" ] || payload_memtest="n" [ "$(uname -m)" = "x86_64" ] || payload_memtest="n"
[ "$payload_grub_withseabios" = "y" ] && eval "$(setvars "y" \ [ "$payload_grub_withseabios" = "y" ] && eval `setvars "y" \
payload_grub payload_seabios payload_seabios_withgrub)" payload_grub payload_seabios payload_seabios_withgrub`
[ "$payload_seabios_withgrub" = "y" ] && payload_seabios="y" [ "$payload_seabios_withgrub" = "y" ] && payload_seabios="y"
[ "$payload_seabios_grubonly" = "y" ] && \ [ "$payload_seabios_grubonly" = "y" ] && \
eval "$(setvars "y" payload_seabios payload_seabios_withgrub)" eval `setvars "y" payload_seabios payload_seabios_withgrub`
# The reverse logic must not be applied. If SeaBIOS-with-GRUB works, # The reverse logic must not be applied. If SeaBIOS-with-GRUB works,
# that doesn't mean GRUB-with-SeaBIOS will, e.g. VGA ROM execution # that doesn't mean GRUB-with-SeaBIOS will, e.g. VGA ROM execution

View File

@ -10,9 +10,9 @@ set -u -e
. "include/git.sh" . "include/git.sh"
cbmakeargs="UPDATED_SUBMODULES=1 CPUS=$threads" cbmakeargs="UPDATED_SUBMODULES=1 CPUS=$threads"
eval "$(setvars "" xarch cdir config config_name xlang mode makeargs \ eval `setvars "" xarch cdir config config_name xlang mode makeargs \
listfile project target target_dir targets tree _f target1 bootstrapargs \ listfile project target target_dir targets tree _f target1 bootstrapargs \
autoconfargs cmakedir elfdir autogenargs xtree)" autoconfargs cmakedir elfdir autogenargs xtree`
main() main()
{ {
@ -150,8 +150,8 @@ handle_src_tree()
load_project_config() load_project_config()
{ {
eval "$(setvars "" xarch xlang tree bootstrapargs autoconfargs xtree \ eval `setvars "" xarch xlang tree bootstrapargs autoconfargs xtree \
tree_depend makeargs)" tree_depend makeargs`
eval `setcfg "$1/target.cfg" 0`; return 0 eval `setcfg "$1/target.cfg" 0`; return 0
} }
@ -270,7 +270,7 @@ check_makefile()
mkpayload_grub() mkpayload_grub()
{ {
eval "$(setvars "" grub_modules grub_install_modules)" eval `setvars "" grub_modules grub_install_modules`
eval `setcfg "$grubdata/module/$tree"` eval `setcfg "$grubdata/module/$tree"`
chkvars "grub_install_modules" "grub_modules" chkvars "grub_install_modules" "grub_modules"