xbmk: don't use backticks for command substitution

the newer way handles escaped characters better, and it
can be nested more easily. it's also more readable.

personally, i prefer the old way, because it's more
minimalist, but it occurs to me that a lot of people
nowadays don't know about backticks, but they do know
of the modern way.

to make the code more readable, i have modernised it.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-09-11 10:17:50 +01:00
parent 5cfe54b06d
commit 4999a49de3
10 changed files with 58 additions and 56 deletions
+7 -7
View File
@@ -2,8 +2,8 @@
# Copyright (c) 2020-2021,2023-2025 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
eval "`setvars "" loc url bkup_url subcurl subhash subgit subgit_bkup \
depend subcurl_bkup`"
eval "$(setvars "" loc url bkup_url subcurl subhash subgit subgit_bkup \
depend subcurl_bkup)"
tmpgit="$xbtmp/gitclone"
tmpgitcache="$xbtmp/tmpgit"
@@ -16,8 +16,8 @@ fetch_targets()
fetch_project()
{
eval "`setvars "" xtree`"
eval "`setcfg "config/git/$project/pkg.cfg"`"
eval "$(setvars "" xtree)"
eval "$(setcfg "config/git/$project/pkg.cfg")"
chkvars url bkup_url && [ -n "$xtree" ] && x_ ./mk -f coreboot "$xtree"
[ -z "$depend" ] || for d in $depend ; do
@@ -55,8 +55,8 @@ git_prep()
fetch_submodule()
{
mcfgdir="$mdir/${1##*/}"; eval \
"`setvars "" subhash subgit subgit_bkup subcurl subcurl_bkup st`"
eval "`setcfg "$mcfgdir/module.cfg" 0`"
"$(setvars "" subhash subgit subgit_bkup subcurl subcurl_bkup st)"
eval "$(setcfg "$mcfgdir/module.cfg" 0)"
for xt in git curl; do
_seval="if [ -n \"\$sub$xt\" ] || [ -n \"\$sub${xt}_bkup\" ]"
@@ -133,7 +133,7 @@ try_copy()
try_git()
{
gitdest="`findpath "$1"`" || err "Can't get readpath for '$1'"
gitdest="$(findpath "$1" || err "Can't get readpath for '$1'")" || err
x_ rm -Rf "$tmpgitcache"
[ -d "$gitdest" ] || ( x_ git clone "$2" "$tmpgitcache" ) || return 1