diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-03-11 20:40:11 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-04-09 00:42:47 +0200 |
commit | 569876f9309fc04d6f77f852c5ca096721d6044b (patch) | |
tree | d46c05d6af70c8e709d2af2b128f60264a97c33a /scripts/makepkg.sh.in | |
parent | ecd6eddf13f0fc24a281b2af9725896492bb6ad4 (diff) | |
download | pacman-569876f9309fc04d6f77f852c5ca096721d6044b.tar.gz pacman-569876f9309fc04d6f77f852c5ca096721d6044b.tar.xz |
makepkg: treat lib{provides,depends} returns as proper arrays
Make these functions more whitespace space by treating newlines as the
element delimiter rather than every form of whitespace.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r-- | scripts/makepkg.sh.in | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index ac803a10..1fa4819a 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1100,14 +1100,14 @@ find_libdepends() { find_libprovides() { local libprovides missing - for p in ${provides[@]}; do + for p in "${provides[@]}"; do missing=0 case "$p" in *.so) - local filename=$(find "$pkgdir" -type f -name $p\*) + IFS=$'\n' read -rd '' -a filename < <(find "$pkgdir" -type f -name $p\*) if [[ $filename ]]; then # packages may provide multiple versions of the same library - for fn in ${filename[@]}; do + for fn in "${filename[@]}"; do # check if we really have a shared object if LC_ALL=C readelf -h "$fn" 2>/dev/null | grep -q '.*Type:.*DYN (Shared object file).*'; then # get the string binaries link to (e.g. libfoo.so.1.2 -> libfoo.so.1) @@ -1195,15 +1195,15 @@ write_pkginfo() { [[ $optdepends ]] && printf "optdepend = %s\n" "${optdepends[@]//+([[:space:]])/ }" [[ $conflicts ]] && printf "conflict = %s\n" "${conflicts[@]}" - provides=($(find_libprovides)) + IFS=$'\n' read -rd '' -a provides < <(find_libprovides) [[ $provides ]] && printf "provides = %s\n" "${provides[@]}" [[ $backup ]] && printf "backup = %s\n" "${backup[@]}" local it - libdepends=$(find_libdepends) - depends+=(${libdepends}) + IFS=$'\n' read -rd '' -a libdepends < <(find_libdepends) + depends+=("${libdepends[@]}") for it in "${depends[@]}"; do if [[ $it = *.so ]]; then |