init.sh: simplify dependencies handling

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-04 08:29:19 +01:00
parent 674fc35011
commit 3c0bef558d
+2 -5
View File
@@ -26,10 +26,7 @@ xbmk_init()
export PWD="$xbmkpwd" export PWD="$xbmkpwd"
if [ $# -gt 0 ] && [ "$1" = "dependencies" ]; then [ $# -gt 0 ] && [ "$1" = "dependencies" ] && x_ xbmkpkg "$@" && exit 0
install_packages "$@" || exit 1
exit 0
fi
id -u 1>/dev/null 2>/dev/null || $err "suid check failed (id -u)" id -u 1>/dev/null 2>/dev/null || $err "suid check failed (id -u)"
[ "$(id -u)" != "0" ] || $err "this command as root is not permitted" [ "$(id -u)" != "0" ] || $err "this command as root is not permitted"
@@ -40,7 +37,7 @@ xbmk_init()
done done
} }
install_packages() xbmkpkg()
{ {
[ $# -lt 2 ] && $err "fewer than two arguments" [ $# -lt 2 ] && $err "fewer than two arguments"
[ $# -gt 2 ] && reinstall="$3" [ $# -gt 2 ] && reinstall="$3"