mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-09-19 21:20:31 +02:00
mk: simplified command handling
just do includes in mk again. common.sh was stupidly small, just pointless. replace the entire command dispatcher with eval, printf and awk, because i can, and it further reduces sloccount. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
. "include/lib.sh"
|
||||
. "include/env/init.sh"
|
||||
. "include/env/get.sh"
|
||||
|
||||
. "include/fw/vendor.sh"
|
||||
. "include/fw/mrc.sh"
|
||||
. "include/fw/inject.sh"
|
||||
. "include/fw/rom.sh"
|
||||
|
||||
. "include/mk/release.sh"
|
||||
|
||||
# tree.sh is included from the main mk script
|
||||
|
||||
xbcommands=" \
|
||||
version \
|
||||
release \
|
||||
download \
|
||||
inject \
|
||||
"
|
||||
@@ -191,30 +191,6 @@ x_()
|
||||
"$@" || err "Unhandled error" "x_" "$@"
|
||||
}
|
||||
|
||||
xeq()
|
||||
{
|
||||
[ $# -lt 2 ] && \
|
||||
err "no args" xeq
|
||||
|
||||
xbcmd="$1"
|
||||
chk="$2"
|
||||
shift 2
|
||||
|
||||
case "$chk" in
|
||||
-*)
|
||||
return 1
|
||||
;;
|
||||
*)
|
||||
for eq in "$@"; do
|
||||
[ "$chk" = "$eq" ] && \
|
||||
return 0; :
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
err "bad command" xeq "$xbcmd" "$chk" "$@"
|
||||
}
|
||||
|
||||
xchk()
|
||||
{
|
||||
if [ $# -lt 3 ]; then
|
||||
|
||||
Reference in New Issue
Block a user