summaryrefslogtreecommitdiff
path: root/abuild
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-20 10:33:11 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-20 10:33:11 +0000
commit7f97d718741303734576184aed690746a48895b6 (patch)
treece03806013931fff50d746d6781af9a6dc925f44 /abuild
parente543ba5d8be86d7fb1c6e533c6b3e538678d40e6 (diff)
downloadabuild-7f97d718741303734576184aed690746a48895b6.tar.gz
abuild-7f97d718741303734576184aed690746a48895b6.tar.bz2
abuild-7f97d718741303734576184aed690746a48895b6.tar.xz
abuild-7f97d718741303734576184aed690746a48895b6.zip
abuild:
try deal with dependencies for makedepends Example. foo-dev is a makedepends which depends on foo. We need to install foo before we can install foo-dev. The way we deal with thi here is hackish and should be replaced by adding all built packages to an abuild repository or similar.
Diffstat (limited to 'abuild')
-rwxr-xr-xabuild32
1 files changed, 28 insertions, 4 deletions
diff --git a/abuild b/abuild
index d905aec..e7a6650 100755
--- a/abuild
+++ b/abuild
@@ -49,7 +49,7 @@ set_xterm_title() {
cleanup() {
set_xterm_title ""
if [ -z "$install_after" ] && [ -n "$uninstall_after" ]; then
- sudo apk delete $uninstall_after
+ sudo apk del $uninstall_after
fi
}
@@ -438,7 +438,7 @@ deptrace() {
( depparse_aports
if [ -z "$upgrade" ]; then
# list installed pkgs and prefix with 'i '
- apk info | sed 's/-[0-9].*//; s/^/i /'
+ apk info -q | sort | sed 's/^/i /'
fi
) | awk -v pkgs="$BUILD_BASE $depends $makedepends" '
@@ -521,6 +521,31 @@ listpkg() {
done
}
+subpackages_has() {
+ local i
+ for i in $subpackages; do
+ [ "$1" = "${i%:*}" ] && return 0
+ done
+ return 1
+}
+
+# install package after build
+post_add() {
+ local pkgf="$PKGDEST/$1-$pkgver-r$pkgrel.apk"
+ local deps i
+ if ! subpackages_has $1 && [ "$1" != "$pkgname" ]; then
+ die "$1 is not built by this APKBUILD"
+ fi
+ # recursively install dependencies that are provided by this APKBUILD
+ deps=$(apk index "$pkgf" 2>/dev/null | awk -F: '$1=="D" { print $2 }')
+ for i in $deps; do
+ if subpackages_has $i || [ "$i" = "$pkgname" ]; then
+ post_add $i || return 1
+ fi
+ done
+ sudo apk add -u "$pkgf" || die "Failed to install $1"
+}
+
usage() {
echo "$(basename $0) $abuild_ver"
echo "usage: $0 [options] [-i PKG] [-p PKGDEST] [-s SRCDEST] [cmd] ..."
@@ -601,8 +626,7 @@ while [ $# -gt 0 ]; do
done
for i in $install_after; do
- sudo apk add -u $PKGDEST/$i-$pkgver-r$pkgrel.apk \
- || die "Failed to install $i"
+ post_add $i
done
cleanup