mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-10 16:49:48 +00:00
abuild: check is so: provides are provided by own subpackage
This commit is contained in:
parent
3bd2388915
commit
df83f78d71
39
abuild.in
39
abuild.in
@ -858,10 +858,14 @@ find_so_files() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subpkg_provides() {
|
||||||
|
grep -q -w "^$1" "$pkgbasedir"/.control.*/.provides-so 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
trace_apk_deps() {
|
trace_apk_deps() {
|
||||||
local name="$1"
|
local name="$1"
|
||||||
local dir="$2"
|
local dir="$2"
|
||||||
local i= j= found= autodeps= deppkgs= missing= so_paths= self_provided=
|
local i= found= autodeps= deppkgs= missing=
|
||||||
msg "Tracing dependencies..."
|
msg "Tracing dependencies..."
|
||||||
# add pkgconfig if usr/lib/pkgconfig is found
|
# add pkgconfig if usr/lib/pkgconfig is found
|
||||||
if [ -d "$pkgbasedir"/$name/usr/lib/pkgconfig ] \
|
if [ -d "$pkgbasedir"/$name/usr/lib/pkgconfig ] \
|
||||||
@ -877,42 +881,29 @@ trace_apk_deps() {
|
|||||||
msg " added libgcc (due to libpthread)"
|
msg " added libgcc (due to libpthread)"
|
||||||
fi
|
fi
|
||||||
[ -f "$dir"/.needs-so ] && for i in $(cat "$dir"/.needs-so); do
|
[ -f "$dir"/.needs-so ] && for i in $(cat "$dir"/.needs-so); do
|
||||||
found=
|
# first check if its provided by same apkbuild
|
||||||
# first check if its provide by same apkbuild
|
grep -q -w "^$i" "$dir"/.provides-so 2>/dev/null && continue
|
||||||
for j in "$dir"/../.control.*/.provides-so; do
|
|
||||||
grep -q -w "^$i" "$j" || continue
|
if subpkg_provides "$i" || $APK info -q -e "so:$i"; then
|
||||||
found=${j%/.provides-so}
|
autodeps="$autodeps so:$i"
|
||||||
found=${found##*/.control.}
|
|
||||||
break
|
|
||||||
done
|
|
||||||
if [ -n "$found" ]; then
|
|
||||||
if ! list_has "$found" $self_provided; then
|
|
||||||
self_provided="$self_provided $found"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if $APK info --quiet --installed "so:$i"; then
|
missing="$missing $i"
|
||||||
autodeps="$autodeps so:$i"
|
|
||||||
else
|
|
||||||
missing="$missing $i"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# find all packages that holds the so files
|
# find all packages that holds the so files
|
||||||
if [ -f "$dir"/.rpaths ]; then
|
if [ -f "$dir"/.rpaths ]; then
|
||||||
so_files=$(find_so_files "$dir"/.rpaths $missing) || return 1
|
local so_files=$(find_so_files "$dir"/.rpaths $missing) \
|
||||||
|
|| return 1
|
||||||
deppkgs=$($APK info -q -W $so_files) || return 1
|
deppkgs=$($APK info -q -W $so_files) || return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for found in $self_provided $deppkgs; do
|
for found in $deppkgs; do
|
||||||
if grep -w "^depend = ${found}$" "$dir"/.PKGINFO >/dev/null ; then
|
if grep -w "^depend = ${found}$" "$dir"/.PKGINFO >/dev/null ; then
|
||||||
warning "You can remove '$found' from depends"
|
warning "You can remove '$found' from depends"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [ "$found" != "$name" ] && ! list_has "$found" $autodeps; then
|
autodeps="$autodeps $found"
|
||||||
autodeps="$autodeps $found"
|
|
||||||
msg " added $found"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "# automatically detected:" >> "$dir"/.PKGINFO
|
echo "# automatically detected:" >> "$dir"/.PKGINFO
|
||||||
|
Loading…
Reference in New Issue
Block a user