minor cleanup

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-09-17 11:02:02 +01:00
parent f59e5d8e2b
commit a0951d1127
5 changed files with 14 additions and 28 deletions
+4 -9
View File
@@ -11,8 +11,7 @@ tmpgitcache="$xbtmp/tmpgit"
multi_tree_fetch()
{
[ -d "src/$project/$tree" ] && \
return 0
[ -d "src/$project/$tree" ] && return 0
git_prep "$url" "$bkup_url" "$xbmkpwd/$configdir/$tree/patches" \
"src/$project/$tree" "submod"
@@ -46,8 +45,7 @@ single_tree_fetch()
clone_project()
{
loc="src/$project"
[ -d "$loc" ] && \
return 0
[ -d "$loc" ] && return 0
remkdir "${tmpgit%/*}"
git_prep "$url" "$bkup_url" "$xbmkpwd/config/$project/patches" "$loc"
@@ -79,9 +77,7 @@ fetch_submodule()
mcfgdir="$mdir/${1##*/}"
eval "`newvar st subcurl subcurl_bkup subgit subgit_bkup subhash`"
if e "$mcfgdir/module.cfg" f missing; then
return 0
fi
e "$mcfgdir/module.cfg" f missing && return 0
. "$mcfgdir/module.cfg" || \
err "Can't read '$mcfgdir/module.cfg'" "fetch_submodules" "$@"
@@ -117,8 +113,7 @@ xbget()
err "empty URL given in" "xbget" "$@"
try_fetch_$1 "$url" "$@" || \
continue
[ -e "$4" ] && \
return 0; : # successful download/copy
[ -e "$4" ] && return 0; : # successful download/copy
done
err "failed to download file/repository" "xbget" "$@"; :
+2 -4
View File
@@ -44,8 +44,7 @@ inject()
check_release
if check_target; then
patch_release || \
return 0; :
patch_release || return 0
fi
[ "$xchanged" = "y" ] && \
remktar
@@ -84,8 +83,7 @@ check_release()
check_target()
{
[ "$board" != "${board#serprog_}" ] && \
return 1
[ "$board" = "${board#serprog_}" ] || return 1
boarddir="$cbcfgsdir/$board"
+2 -4
View File
@@ -72,9 +72,8 @@ check_coreboot_util()
{
[ "$badhash" = "y" ] && \
x_ rm -f "elf/coreboot/$tree/$1"
if e "elf/coreboot/$tree/$1" f; then
e "elf/coreboot/$tree/$1" f && \
return 0
fi
utilelfdir="elf/coreboot/$tree"
utilsrcdir="src/coreboot/$tree/util/$1"
@@ -124,8 +123,7 @@ mkcorebootbin()
mkcorebootbin_real()
{
[ "$target" = "$tree" ] && \
return 0
[ "$target" = "$tree" ] && return 0
tmprom="$xbtmp/coreboot.rom"
+5 -9
View File
@@ -153,8 +153,7 @@ fetch()
( fx_ "mkdst $binsum" x_ find "${_pre_dest%/*}" -type f ) || :
bad_checksum "$binsum" "$_dest" || \
[ ! -f "$_dest" ] || \
return 0; :
[ ! -f "$_dest" ] || return 0; :
x_ rm -f "$_dest"
@@ -380,17 +379,15 @@ setvfile()
eval "$vcmd && do_getvfile=\"y\""
[ "$do_getvfile" = "y" ] && \
if getvfile "$@"; then
return 0
fi; :
getvfile "$@" && \
return 0; :
done && return 1; :
}
getvfile()
{
if e "config/vendor/$vcfg/pkg.cfg" f missing; then
e "config/vendor/$vcfg/pkg.cfg" f missing && \
return 1
fi
. "config/vendor/$vcfg/pkg.cfg" || \
err "Can't read 'config/vendor/$vcfg/pkg.cfg'" "getvfile" "$@"
@@ -442,9 +439,8 @@ prep()
[ "$nuke" = "nuke" ] && \
_xromnew="${_xrom%/*}/$vfix${_xrom##*/}"
if e "$_xrom" f missing; then
e "$_xrom" f missing && \
return 0
fi
[ -z "${_xromname#"$vfix"}" ] && \
err "$_xromname / $vfix: name match" "prep" "$@"
+1 -2
View File
@@ -144,8 +144,7 @@ dx_()
{
xchk dx_ "$@"
[ ! -f "$2" ] && \
return 0
[ ! -f "$2" ] && return 0
while read -r fx; do
$1 "$fx" || return 1; :