mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-11 09:19:40 +00:00
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.
This commit is contained in:
parent
e543ba5d8b
commit
7f97d71874
32
abuild
32
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
|
||||
|
Loading…
Reference in New Issue
Block a user