summaryrefslogtreecommitdiff
path: root/lbmk
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-08-20 21:17:02 +0100
committerLeah Rowe <leah@libreboot.org>2023-08-20 21:25:51 +0100
commit9031bb7ba79022f1334b05d4d8d5caaadf775bac (patch)
tree66aeea1610f953049c725e38491566c1e4d4dd65 /lbmk
parent023d6b69968b44e296caee308c173cb617b89497 (diff)
unify dependencies scripts
the unified logic is so small that i simply added it to the main "build" script commands are identical. example: ./build dependencies debian Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'lbmk')
-rwxr-xr-xlbmk20
1 files changed, 18 insertions, 2 deletions
diff --git a/lbmk b/lbmk
index 3f472b1e..c71b64a7 100755
--- a/lbmk
+++ b/lbmk
@@ -40,10 +40,13 @@ main()
buildpath="./resources/scripts/${0##*/}"
mode="${1}"
+ if [ "${mode}" = "dependencies" ]; then
+ install_dependencies $@ || die "Could not install dependencies"
+ exit 0
+ fi
./.gitcheck
- if [ "${mode}" != "dependencies" ]; then
+ [ "${mode}" != "dependencies" ] && \
./resources/scripts/misc/versioncheck
- fi
if [ "${mode}" = help ]; then
usage $0
exit 0
@@ -80,6 +83,19 @@ main()
./.gitcheck clean
}
+install_dependencies()
+{
+ [ -f "resources/dependencies/${2}" ] || die "Unsupported target"
+
+ aur_notice=""
+ . "resources/dependencies/${2}"
+
+ ${pkg_add} ${pkglist} || die "Error installing dependencies"
+ [ "${aur_notice}" != "" ] && \
+ printf "You must install these AUR packages: %s\n" \
+ "${aur_notice}" 1>&2
+}
+
# Takes exactly one mode as parameter
listoptions()
{