diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-09-12 07:03:41 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-09-14 06:09:35 +0000 |
commit | fe6419454b38beb5c585044739f2551043363a0b (patch) | |
tree | 44044ac1a77f57a6f621e8bfafb9b9906037901b /abuild.in | |
parent | 53fb2f62ab306b8f4cb8b4ef55e8f7e6bdec475c (diff) | |
download | abuild-fe6419454b38beb5c585044739f2551043363a0b.tar.gz abuild-fe6419454b38beb5c585044739f2551043363a0b.tar.bz2 abuild-fe6419454b38beb5c585044739f2551043363a0b.tar.xz abuild-fe6419454b38beb5c585044739f2551043363a0b.zip |
abuild: avoid scanning dirs more than once
Diffstat (limited to 'abuild.in')
-rwxr-xr-x | abuild.in | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -923,7 +923,7 @@ trace_apk_deps() { } find_scanelf_paths() { - local controldir="$1" datadir="$2" + local datadir="$1" local paths="$datadir/lib:$datadir/usr/lib" i= rpaths= if [ -n "$ldpath" ]; then paths="$paths:$(echo "$ldpath" | sed "s|\(^\|:\)|\1$datadir|g")" @@ -932,9 +932,12 @@ find_scanelf_paths() { for rpaths in "$pkgbasedir"/.control.*/.rpaths; do [ -f "$rpaths" ] || continue while read i; do - if [ -d "$datadir/$i" ]; then - paths="$paths:$datadir/$i" + local dir="${datadir}${i}" + IFS=: + if [ -d "$dir" ] && ! list_has "$dir" $paths; then + paths="$paths:${dir}" fi + unset IFS done < "$rpaths" done echo "$paths" @@ -946,7 +949,7 @@ scan_shared_objects() { # allow spaces in paths IFS=: - set -- $(find_scanelf_paths "$controldir" "$datadir") + set -- $(find_scanelf_paths "$datadir") unset IFS if options_has "ldpath-recursive"; then |