Commit a878a546 authored by Natanael Copa's avatar Natanael Copa
Browse files

abuild: bugfix: find deps in subpackages and fail if deps not found

parent 2d6f0ab3
...@@ -370,7 +370,7 @@ EOF ...@@ -370,7 +370,7 @@ EOF
prepare_tracedeps() { prepare_tracedeps() {
local dir=${subpkgdir:-$pkgdir} local dir=${subpkgdir:-$pkgdir}
options_has "!tracedeps" && return 0 options_has "!tracedeps" && return 0
find -name '*.so' | sed 's:.*/::' >"$dir"/.provides-so find -name '*.so' -o -name '*.so.[0-9]*' | sed 's:.*/::' >"$dir"/.provides-so
scanelf -Rn "$dir" | awk '$1 == "ET_DYN" || $1 == "ET_EXEC" {print $2}' \ scanelf -Rn "$dir" | awk '$1 == "ET_DYN" || $1 == "ET_EXEC" {print $2}' \
| sed 's:,:\n:g' | sort | uniq \ | sed 's:,:\n:g' | sort | uniq \
| while read i; do | while read i; do
...@@ -396,17 +396,16 @@ pkginfo_val() { ...@@ -396,17 +396,16 @@ pkginfo_val() {
trace_apk_deps() { trace_apk_deps() {
local name="$1" local name="$1"
local dir="$2" local dir="$2"
local i autodeps= local i j found autodeps=
msg "Tracing dependencies..." msg "Tracing dependencies for $name..."
for i in $(cat "$dir"/.needs-so 2>/dev/null); do for i in $(cat "$dir"/.needs-so 2>/dev/null); do
local j found found=
# first check if its provide by same apkbuild # first check if its provide by same apkbuild
for j in ../*/.provides-so; do for j in "$dir"/../*/.provides-so; do
if grep -w $i $j >/dev/null 2>&1; then grep -w "$i" "$j" >/dev/null || continue
j=${j##*/} found=${j##*/}
found=${j%.*} found=${found%/*}
break break
fi
done done
# check apk db if not provided by a subpackage # check apk db if not provided by a subpackage
if [ -z "$found" ]; then if [ -z "$found" ]; then
...@@ -420,8 +419,8 @@ trace_apk_deps() { ...@@ -420,8 +419,8 @@ trace_apk_deps() {
warning "You can remove '$found' from depends" warning "You can remove '$found' from depends"
continue continue
fi fi
list_has $found $autodeps || autodeps="$autodeps $found" list_has "$found" $autodeps || autodeps="$autodeps $found"
msg "Added $found as dependency as it has $i" msg "Added '$found' as dependency as it has $i"
done done
[ -z "$autodeps" ] && return 0 [ -z "$autodeps" ] && return 0
echo "# automatically detected:" >> "$dir"/.PKGINFO echo "# automatically detected:" >> "$dir"/.PKGINFO
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment