summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-23 08:56:55 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-23 08:56:55 +0000
commitba3d54d4171d9681cd36cf7e3f420cffa77c919d (patch)
treec69faa2214ffc03aaf96456c28f100d694a718ce
parentac04e75b81969ec19b1d5d58bd56939047d0282a (diff)
downloadabuild-ba3d54d4171d9681cd36cf7e3f420cffa77c919d.tar.gz
abuild-ba3d54d4171d9681cd36cf7e3f420cffa77c919d.tar.bz2
abuild-ba3d54d4171d9681cd36cf7e3f420cffa77c919d.tar.xz
abuild-ba3d54d4171d9681cd36cf7e3f420cffa77c919d.zip
mkalpine: install missing apps to build iso
I'm not sure if we really want this
-rwxr-xr-xmkalpine22
1 files changed, 22 insertions, 0 deletions
diff --git a/mkalpine b/mkalpine
index d9ee38b..f56b8b9 100755
--- a/mkalpine
+++ b/mkalpine
@@ -1,5 +1,21 @@
#!/bin/sh
+# check if what we need is here
+needed="cramfs syslinux cdrkit"
+for i in $needed; do
+ if ! apk info -e $i; then
+ missing="$missing $i"
+ fi
+done
+
+# try install the missing parts
+if [ -n "$missing" ]; then
+ if ! sudo apk add $missing; then
+ echo "Need $missing to build alpine" >&2
+ exit 1
+ fi
+fi
+
# first look for alpine.mk in current dir. Fallback to /usr/share/abuild
mk=./alpine.mk
if ! [ -f $mk ]; then
@@ -7,3 +23,9 @@ if ! [ -f $mk ]; then
fi
make -f "$mk" APK_BIN= $@
+rc=$?
+
+# uninstall the stuff we installed
+[ -n "$missing" ] && sudo apk del $missing
+
+exit $?