remove use of _xm variable in the build system

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2
Leah Rowe 2024-06-27 22:18:01 +01:00 committed by Leah Rowe
parent 7451fa629c
commit 1fbfc7303d
2 changed files with 11 additions and 13 deletions

19
build
View File

@ -14,7 +14,7 @@ fi
. "include/lib.sh" . "include/lib.sh"
eval `setvars "" vdir src_dirname srcdir _xm mode xp` eval `setvars "" vdir src_dirname srcdir mode xp`
err="fail" err="fail"
main() main()
@ -85,9 +85,8 @@ mkrelease()
build_release() build_release()
{ {
_xm="build_release $vdir"
( (
cd "$srcdir" || $err "$_xm: !cd \"$srcdir\"" cd "$srcdir" || $err "$vdir: !cd \"$srcdir\""
fetch_trees fetch_trees
x_ mv src/docs docs x_ mv src/docs docs
) || $err "can't create release files" ) || $err "can't create release files"
@ -97,18 +96,18 @@ build_release()
rm -f "$srcdir/lock" || $err "can't remove lock file in $srcdir" rm -f "$srcdir/lock" || $err "can't remove lock file in $srcdir"
( (
cd "${srcdir%/*}" || $err "$_xm: mktarball \"$srcdir\"" cd "${srcdir%/*}" || $err "$vdir: mktarball \"$srcdir\""
mktarball "${srcdir##*/}" "${srcdir##*/}.tar.xz" || $err "$_xm: mksrc" mktarball "${srcdir##*/}" "${srcdir##*/}.tar.xz" || $err "$vdir: mksrc"
) || $err "can't create src tarball" ) || $err "can't create src tarball"
[ "$mode" = "src" ] && return 0 [ "$mode" = "src" ] && return 0
touch "$srcdir/lock" || $err "can't make lock file in $srcdir/" touch "$srcdir/lock" || $err "can't make lock file in $srcdir/"
( (
cd "$srcdir" || $err "$_xm: 2 !cd \"$srcdir\"" cd "$srcdir" || $err "$vdir: 2 !cd \"$srcdir\""
./build roms all || $err "$_xm: roms-all" ./build roms all || $err "$vdir: roms-all"
./build roms serprog rp2040 || $err "$_xm: rp2040" ./build roms serprog rp2040 || $err "$vdir: rp2040"
./build roms serprog stm32 || $err "$_xm: stm32" ./build roms serprog stm32 || $err "$vdir: stm32"
x_ mv bin ../roms x_ mv bin ../roms
) || $err "can't build rom images" ) || $err "can't build rom images"
@ -118,7 +117,7 @@ build_release()
fetch_trees() fetch_trees()
{ {
for x in $(ls -1 config/git); do for x in $(ls -1 config/git); do
./update trees -f "$x" || $err "$_xm: fetch $x" ./update trees -f "$x" || $err "$vdir: fetch $x"
singletree "$x" || x_ rm -Rf "src/$x/$x" singletree "$x" || x_ rm -Rf "src/$x/$x"
done done
rmgit . rmgit .

View File

@ -2,7 +2,7 @@
# Copyright (c) 2020-2021,2023-2024 Leah Rowe <leah@libreboot.org> # Copyright (c) 2020-2021,2023-2024 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com> # Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
eval `setvars "" _target rev _xm loc url bkup_url depend tree_depend xtree \ eval `setvars "" _target rev loc url bkup_url depend tree_depend xtree \
mdir subhash subrepo subrepo_bkup subfile subfile_bkup` mdir subhash subrepo subrepo_bkup subfile subfile_bkup`
fetch_project_trees() fetch_project_trees()
@ -20,7 +20,6 @@ fetch_config()
eval `setvars "" xtree tree_depend` eval `setvars "" xtree tree_depend`
while true; do while true; do
eval `setvars "" rev tree` eval `setvars "" rev tree`
_xm="fetch_config $project/$_target"
load_target_config "$_target" load_target_config "$_target"
[ "$_target" = "$tree" ] && break [ "$_target" = "$tree" ] && break
_target="$tree" _target="$tree"
@ -31,7 +30,7 @@ fetch_config()
load_target_config() load_target_config()
{ {
[ -f "$cfgsdir/$1/seen" ] && $err "$_xm cfg: infinite loop in trees" [ -f "$cfgsdir/$1/seen" ] && $err "$project/$_target: tree loop"
eval `setcfg "$cfgsdir/$1/target.cfg"` eval `setcfg "$cfgsdir/$1/target.cfg"`
touch "$cfgsdir/$1/seen" || $err "load_config $cfgsdir/$1: !mk seen" touch "$cfgsdir/$1/seen" || $err "load_config $cfgsdir/$1: !mk seen"
} }