get.sh: simplify fetch_submodules() config check

We already do what the old code does in setcfg, by
virtue of the fact that the st variable is later
checked, after loading this config conditionally,
where the st variable is otherwise blank.

We can avoid the unnecessary work after loading
the config, by returning if the config is absent.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-14 16:48:25 +01:00
parent 21867b7d80
commit 8d5475ed5b
+1 -2
View File
@@ -66,8 +66,7 @@ fetch_submodule()
{
mcfgdir="$mdir/${1##*/}"; eval \
"`setvars "" subhash subgit subgit_bkup subcurl subcurl_bkup st`"
[ ! -f "$mcfgdir/module.cfg" ] || . "$mcfgdir/module.cfg" || \
err "! . $mcfgdir/module.cfg"
eval "`setcfg "$mcfgdir/module.cfg" 0`"
for xt in git curl; do
_seval="if [ -n \"\$sub$xt\" ] || [ -n \"\$sub${xt}_bkup\" ]"