diff options
author | Leah Rowe <leah@libreboot.org> | 2025-09-11 10:17:50 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-09-11 10:29:59 +0100 |
commit | 4999a49de39667b3239fc2010d0e99c958b29417 (patch) | |
tree | dfa4897896de0bc0c93c5133052a566b5339c138 /include/get.sh | |
parent | 5cfe54b06d74e6392fc7312c41b5ca299704f7ca (diff) |
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>
Diffstat (limited to 'include/get.sh')
-rw-r--r-- | include/get.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/get.sh b/include/get.sh index ecfd0ba5..bee00fe1 100644 --- a/include/get.sh +++ b/include/get.sh @@ -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 |