vendor.sh: condense detect_board() a bit

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit6
Leah Rowe 2024-06-29 01:47:14 +01:00
parent bf5acedb12
commit 972e61070b
1 changed files with 3 additions and 6 deletions

View File

@ -264,17 +264,14 @@ detect_board()
path="$1"
filename="$(basename "$path")"
case "$filename" in
grub_*)
board="$(echo "$filename" | cut -d '_' -f2-3)" ;;
grub_*) board="$(echo "$filename" | cut -d '_' -f2-3)" ;;
seabios_withgrub_*)
board="$(echo "$filename" | cut -d '_' -f3-4)" ;;
*.tar.xz)
_stripped_prefix="${filename#*_}"
board="${_stripped_prefix%.tar.xz}" ;;
*)
$err "detect_board $filename: could not detect board type"
esac
printf "%s\n" "$board"
*) $err "detect_board $filename: could not detect board type"
esac; printf "%s\n" "$board"
}
readcfg()