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