abuild: avoid scanning dirs more than once

This commit is contained in:
Natanael Copa 2012-09-12 07:03:41 +00:00
parent 53fb2f62ab
commit fe6419454b
1 changed files with 7 additions and 4 deletions

View File

@ -923,7 +923,7 @@ trace_apk_deps() {
} }
find_scanelf_paths() { find_scanelf_paths() {
local controldir="$1" datadir="$2" local datadir="$1"
local paths="$datadir/lib:$datadir/usr/lib" i= rpaths= local paths="$datadir/lib:$datadir/usr/lib" i= rpaths=
if [ -n "$ldpath" ]; then if [ -n "$ldpath" ]; then
paths="$paths:$(echo "$ldpath" | sed "s|\(^\|:\)|\1$datadir|g")" paths="$paths:$(echo "$ldpath" | sed "s|\(^\|:\)|\1$datadir|g")"
@ -932,9 +932,12 @@ find_scanelf_paths() {
for rpaths in "$pkgbasedir"/.control.*/.rpaths; do for rpaths in "$pkgbasedir"/.control.*/.rpaths; do
[ -f "$rpaths" ] || continue [ -f "$rpaths" ] || continue
while read i; do while read i; do
if [ -d "$datadir/$i" ]; then local dir="${datadir}${i}"
paths="$paths:$datadir/$i" IFS=:
if [ -d "$dir" ] && ! list_has "$dir" $paths; then
paths="$paths:${dir}"
fi fi
unset IFS
done < "$rpaths" done < "$rpaths"
done done
echo "$paths" echo "$paths"
@ -946,7 +949,7 @@ scan_shared_objects() {
# allow spaces in paths # allow spaces in paths
IFS=: IFS=:
set -- $(find_scanelf_paths "$controldir" "$datadir") set -- $(find_scanelf_paths "$datadir")
unset IFS unset IFS
if options_has "ldpath-recursive"; then if options_has "ldpath-recursive"; then