From d4d5d2902c020419057d63c9791804906a6c60dd Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 22 Jun 2024 04:06:07 +0100 Subject: use backticks on eval commands, not subshells Signed-off-by: Leah Rowe --- build | 4 ++-- include/git.sh | 12 ++++++------ include/lib.sh | 4 ++-- include/mrc.sh | 2 +- include/vendor.sh | 6 +++--- script/roms | 13 +++++++------ script/trees | 10 +++++----- 7 files changed, 26 insertions(+), 25 deletions(-) diff --git a/build b/build index dbe7487d..ef5a1109 100755 --- a/build +++ b/build @@ -16,7 +16,7 @@ fi . "include/vendor.sh" . "include/mrc.sh" -eval "$(setvars "" vdir src_dirname srcdir _xm mode xp)" +eval `setvars "" vdir src_dirname srcdir _xm mode xp` err="fail" main() @@ -45,7 +45,7 @@ git_init() { [ -L ".git" ] && return 1 [ -e ".git" ] && return 0 - eval "$(setvars "$(date -Rud @$versiondate)" cdate _nogit)" + eval `setvars "$(date -Rud @$versiondate)" cdate _nogit` git init || return 1 git add -A . || return 1 diff --git a/include/git.sh b/include/git.sh index a10fb014..0c2e816c 100755 --- a/include/git.sh +++ b/include/git.sh @@ -2,8 +2,8 @@ # Copyright (c) 2020-2021,2023-2024 Leah Rowe # Copyright (c) 2022 Caleb La Grange -eval "$(setvars "" _target rev _xm loc url bkup_url depend tree_depend xtree \ - mdir subhash subrepo subrepo_bkup subfile subfile_bkup)" +eval `setvars "" _target rev _xm loc url bkup_url depend tree_depend xtree \ + mdir subhash subrepo subrepo_bkup subfile subfile_bkup` fetch_project_trees() { @@ -17,9 +17,9 @@ fetch_project_trees() fetch_config() { rm -f "$cfgsdir/"*/seen || $err "fetch_config $cfgsdir: !rm seen" - eval "$(setvars "" xtree tree_depend)" + eval `setvars "" xtree tree_depend` while true; do - eval "$(setvars "" rev tree)" + eval `setvars "" rev tree` _xm="fetch_config $project/$_target" load_target_config "$_target" [ "$_target" = "$tree" ] && break @@ -47,7 +47,7 @@ prepare_new_tree() fetch_project_repo() { - eval "$(setvars "" xtree tree_depend)" + eval `setvars "" xtree tree_depend` eval `setcfg "config/git/$project/pkg.cfg"` chkvars url @@ -111,7 +111,7 @@ prep_submodules() fetch_submodule() { 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" || \ $err "! . $mcfgdir/module.cfg" diff --git a/include/lib.sh b/include/lib.sh index c7c0c38d..c62bf98f 100755 --- a/include/lib.sh +++ b/include/lib.sh @@ -42,8 +42,8 @@ chkvars() done } -eval "$(setvars "" xbmk_release tmpdir _nogit version board boarddir relname \ - versiondate threads projectname projectsite aur_notice cfgsdir datadir)" +eval `setvars "" xbmk_release tmpdir _nogit version board boarddir relname \ + versiondate threads projectname projectsite aur_notice cfgsdir datadir` read -r projectname < projectname || : read -r projectsite < projectsite || : diff --git a/include/mrc.sh b/include/mrc.sh index fddaef5d..2e00d9f9 100755 --- a/include/mrc.sh +++ b/include/mrc.sh @@ -4,7 +4,7 @@ # Modifications in this version are Copyright 2021, 2023 and 2024 Leah Rowe. # Original copyright detailed in repo: https://review.coreboot.org/coreboot/ -eval "$(setvars "" MRC_url MRC_url_bkup MRC_hash MRC_board SHELLBALL)" +eval `setvars "" MRC_url MRC_url_bkup MRC_hash MRC_board SHELLBALL` extract_mrc() { diff --git a/include/vendor.sh b/include/vendor.sh index c8512337..949ffc48 100755 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -14,7 +14,7 @@ vendir="vendorfiles" appdir="$vendir/app" cbcfgsdir="config/coreboot" -eval "$(setvars "" EC_url_bkup EC_hash DL_hash DL_url_bkup MRC_refcode_gbe \ +eval `setvars "" EC_url_bkup EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ E6400_VGA_DL_hash E6400_VGA_DL_url E6400_VGA_DL_url_bkup E6400_VGA_offset \ E6400_VGA_romname CONFIG_HAVE_MRC SCH5545EC_DL_url_bkup SCH5545EC_DL_hash \ mecleaner kbc1126_ec_dump MRC_refcode_cbtree new_mac _dl SCH5545EC_DL_url \ @@ -24,7 +24,7 @@ eval "$(setvars "" EC_url_bkup EC_hash DL_hash DL_url_bkup MRC_refcode_gbe \ CONFIG_VGA_BIOS_FILE CONFIG_VGA_BIOS_ID CONFIG_KBC1126_FW1 release DL_url \ CONFIG_INCLUDE_SMSC_SCH5545_EC_FW CONFIG_SMSC_SCH5545_EC_FW_FILE nukemode \ CONFIG_IFD_BIN_PATH CONFIG_MRC_FILE CONFIG_HAVE_REFCODE_BLOB cbfstoolref \ - CONFIG_REFCODE_BLOB_FILE vcfg)" + CONFIG_REFCODE_BLOB_FILE` vendor_download() { @@ -390,7 +390,7 @@ inject() { [ $# -lt 3 ] && $err "$@, $rom: usage: inject name path type (offset)" - eval "$(setvars "" cbfsname _dest _t _offset)" + eval `setvars "" cbfsname _dest _t _offset` cbfsname="$1" _dest="${2##*../}" _t="$3" diff --git a/script/roms b/script/roms index 7b6f8685..9cfab81a 100755 --- a/script/roms +++ b/script/roms @@ -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" v="romdir cbrom initmode displaymode cbcfg targetdir tree release ubootelf" v="$v grub_timeout board grub_scan_disk uboot_config grubtree grubelf tmpmv" -eval "$(setvars "n" $pv)" -eval "$(setvars "" $v boards targets serdir ser)" +eval `setvars "n" $pv` +eval `setvars "" $v boards targets serdir ser` main() { @@ -88,7 +88,8 @@ serlist() configure_target() { - eval "$(setvars "n" $pv) $(setvars "" $v)" + eval `setvars "n" $pv` + eval `setvars "" $v` board="$1" targetdir="$cfgsdir/$board" @@ -106,11 +107,11 @@ configure_target() [ "$payload_memtest" != "y" ] && payload_memtest="n" [ "$(uname -m)" = "x86_64" ] || payload_memtest="n" - [ "$payload_grub_withseabios" = "y" ] && eval "$(setvars "y" \ - payload_grub payload_seabios payload_seabios_withgrub)" + [ "$payload_grub_withseabios" = "y" ] && eval `setvars "y" \ + payload_grub payload_seabios payload_seabios_withgrub` [ "$payload_seabios_withgrub" = "y" ] && payload_seabios="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, # that doesn't mean GRUB-with-SeaBIOS will, e.g. VGA ROM execution diff --git a/script/trees b/script/trees index 82c3ce84..7287280d 100755 --- a/script/trees +++ b/script/trees @@ -10,9 +10,9 @@ set -u -e . "include/git.sh" 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 \ - autoconfargs cmakedir elfdir autogenargs xtree)" + autoconfargs cmakedir elfdir autogenargs xtree` main() { @@ -152,8 +152,8 @@ handle_src_tree() load_project_config() { - eval "$(setvars "" xarch xlang tree bootstrapargs autoconfargs xtree \ - tree_depend makeargs)" + eval `setvars "" xarch xlang tree bootstrapargs autoconfargs xtree \ + tree_depend makeargs` eval `setcfg "$1/target.cfg" 0`; return 0 } @@ -272,7 +272,7 @@ check_makefile() mkpayload_grub() { - eval "$(setvars "" grub_modules grub_install_modules)" + eval `setvars "" grub_modules grub_install_modules` eval `setcfg "$grubdata/module/$tree"` chkvars "grub_install_modules" "grub_modules" -- cgit v1.2.1