mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-27 17:53:54 +00:00
abuild: fix dependency checking
- versioned dependencies - dependencies on 'provides' tags or library names
This commit is contained in:
parent
c909c82ac2
commit
d8174e4f3a
48
abuild.in
48
abuild.in
@ -1855,10 +1855,27 @@ calcdeps() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_missing_deps() {
|
||||||
|
local cmd="$APK info --quiet --installed $1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
while [ "$1" ]; do
|
||||||
|
local cp=${1#\!}
|
||||||
|
if [ $cp != $1 ]; then
|
||||||
|
if $cmd $cp; then
|
||||||
|
error "Conflicting package installed: $cp"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
elif [ "$upgrade" ] || ! $cmd $1; then
|
||||||
|
echo $1
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# build and install dependencies
|
# build and install dependencies
|
||||||
builddeps() {
|
builddeps() {
|
||||||
local pkg= i= missing= BUILD_BASE=
|
local pkg= i= BUILD_BASE=
|
||||||
local installed_hostdeps= installed_builddeps=
|
|
||||||
[ -n "$nodeps" ] && return 0
|
[ -n "$nodeps" ] && return 0
|
||||||
|
|
||||||
msg "Analyzing dependencies..."
|
msg "Analyzing dependencies..."
|
||||||
@ -1872,30 +1889,11 @@ builddeps() {
|
|||||||
esac
|
esac
|
||||||
calcdeps "$BUILD_BASE"
|
calcdeps "$BUILD_BASE"
|
||||||
|
|
||||||
installed_builddeps=$($APK info --installed $builddeps)
|
|
||||||
[ -n "$CBUILDROOT" -a -n "$hostdeps" ] && installed_hostdeps=$($APK info --root "$CBUILDROOT" --arch "$CTARGET_ARCH" --installed $hostdeps)
|
|
||||||
|
|
||||||
# find which deps are missing
|
# find which deps are missing
|
||||||
for i in $builddeps; do
|
local mbd mhd missing
|
||||||
if [ "${i#\!}" != "$i" ]; then
|
mbd=$(get_missing_deps "" $builddeps) || return 1
|
||||||
if $APK info --quiet --installed "${i#\!}"; then
|
mhd=$(get_missing_deps "--root $CBUILDROOT --arch $CTARGET_ARCH" $hostdeps) || return 1
|
||||||
error "Conflicting package installed: ${i#\!}"
|
missing=$(echo $mbd $mhd)
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
elif ! deplist_has $i $installed_builddeps || [ -n "$upgrade" ]; then
|
|
||||||
missing="$missing $i"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
for i in $hostdeps; do
|
|
||||||
if [ "${i#\!}" != "$i" ]; then
|
|
||||||
if $APK info --quiet --installed --root "$CBUILDROOT" --arch "$CTARGET_ARCH" "${i#\!}"; then
|
|
||||||
error "Conflicting package installed: ${i#\!}"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
elif ! deplist_has $i $installed_hostdeps || [ -n "$upgrade" ]; then
|
|
||||||
missing="$missing $i"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$install_deps" ] && [ -z "$recursive" ]; then
|
if [ -z "$install_deps" ] && [ -z "$recursive" ]; then
|
||||||
# if we dont have any missing deps we are done now
|
# if we dont have any missing deps we are done now
|
||||||
|
Loading…
Reference in New Issue
Block a user