build/roms: simplified status handling

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2-merge1
Leah Rowe 2024-04-28 20:33:38 +01:00 committed by Leah Rowe
parent 96eb7913a5
commit 3aa148aa2e
2 changed files with 7 additions and 36 deletions

View File

@ -5,7 +5,7 @@ export LC_COLLATE=C
export LC_ALL=C
version=""; versiondate=""; projectname=""; _nogit=""
err="err_"; tmpdir=""; release_type=""; cbmk_status=""
err="err_"; tmpdir=""; cbmk_status=""
# if "y": a coreboot target won't be built if target.cfg says release="n"
# (this is used to exclude certain build targets from releases)
@ -15,17 +15,6 @@ set | grep CBMK_RELEASE 1>/dev/null 2>/dev/null || cbmk_release="n" || :
[ "$cbmk_release" = "n" ] || [ "$cbmk_release" = "y" ] || cbmk_release="n"
export CBMK_RELEASE="$cbmk_release"
# valid values:
# empty / not set
# value: stable
# value: unstable
# e.g. export CBMK_VERSION_TYPE=stable
set | grep CBMK_VERSION_TYPE 1>/dev/null 2>/dev/null && \
release_type="$CBMK_VERSION_TYPE"
[ -z "$release_type" ] || [ "$release_type" = "stable" ] || \
[ "$release_type" = "unstable" ] || release_type=""
export CBMK_VERSION_TYPE="$release_type"
# if set to n via export, status checks will be skipped during
# all builds, and all targets will be built regardless of status.
# this replicates the old behaviour of cbmk, prior to the checks.

View File

@ -72,13 +72,12 @@ main()
eval "$(setvars "n" ${pv}) $(setvars "" ${v})"
grub_background="background1280x800.png"
board="${x}"
status="unknown"
configure_target
[ "$board" = "$tree" ] && \
continue
handle_status
if [ "$listboards" = "y" ]; then
for _list_type in $list_type; do
[ "$status" != "$_list_type" ] && continue
@ -163,34 +162,17 @@ configure_target()
eval "payload_${_payload}=y"
}
handle_status()
{
[ "$status" = "stable" ] || [ "$status" = "unstable" ] || \
[ "$status" = "broken" ] || [ "$status" = "untested" ] || \
status="unknown"
[ "$listboards" != "y" ] && \
printf "Handling target: %s (status=%s)\n" "$board" "$status"
[ "$status" = "broken" ] && release="n"
[ "$status" = "unknown" ] && release="n"
[ "$status" = "untested" ] && release="n"
[ "$listboards" != "y" ] && \
[ "$status" != "stable" ] && [ "$status" != "$release_type" ] && \
printf "WARNING: %s not marked stable (status=%s):\n\n" \
"$board" "$status"; return 0
}
skip_board()
{
[ "$listboards" != "y" ] && [ "$status" != "stable" ] && \
printf "WARNING: %s not stable (status=%s):\n\n" \
"$board" "$status"
[ "$release" = "n" ] && [ "$cbmk_release" = "y" ] && \
return 0
[ -n "$release_type" ] && [ "$status" = "$release_type" ] && \
return 1
if [ "$cbmk_release" != "y" ] && [ "$status" != "stable" ] && \
[ "$status" != "$release_type" ] && [ "$cbmk_status" = "y" ]; then
[ "$cbmk_status" = "y" ]; then
if [ -f "$targetdir/warn.txt" ]; then
printf "Regarding board '%s' (status '%s'):\n" \
"$board" "$status"