mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 07:48:50 -05:00
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>
This commit is contained in:
parent
ecd6eddf13
commit
569876f930
@ -1100,14 +1100,14 @@ find_libdepends() {
|
|||||||
|
|
||||||
find_libprovides() {
|
find_libprovides() {
|
||||||
local libprovides missing
|
local libprovides missing
|
||||||
for p in ${provides[@]}; do
|
for p in "${provides[@]}"; do
|
||||||
missing=0
|
missing=0
|
||||||
case "$p" in
|
case "$p" in
|
||||||
*.so)
|
*.so)
|
||||||
local filename=$(find "$pkgdir" -type f -name $p\*)
|
IFS=$'\n' read -rd '' -a filename < <(find "$pkgdir" -type f -name $p\*)
|
||||||
if [[ $filename ]]; then
|
if [[ $filename ]]; then
|
||||||
# packages may provide multiple versions of the same library
|
# 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
|
# 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
|
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)
|
# 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:]])/ }"
|
[[ $optdepends ]] && printf "optdepend = %s\n" "${optdepends[@]//+([[:space:]])/ }"
|
||||||
[[ $conflicts ]] && printf "conflict = %s\n" "${conflicts[@]}"
|
[[ $conflicts ]] && printf "conflict = %s\n" "${conflicts[@]}"
|
||||||
|
|
||||||
provides=($(find_libprovides))
|
IFS=$'\n' read -rd '' -a provides < <(find_libprovides)
|
||||||
[[ $provides ]] && printf "provides = %s\n" "${provides[@]}"
|
[[ $provides ]] && printf "provides = %s\n" "${provides[@]}"
|
||||||
|
|
||||||
[[ $backup ]] && printf "backup = %s\n" "${backup[@]}"
|
[[ $backup ]] && printf "backup = %s\n" "${backup[@]}"
|
||||||
|
|
||||||
|
|
||||||
local it
|
local it
|
||||||
libdepends=$(find_libdepends)
|
IFS=$'\n' read -rd '' -a libdepends < <(find_libdepends)
|
||||||
depends+=(${libdepends})
|
depends+=("${libdepends[@]}")
|
||||||
|
|
||||||
for it in "${depends[@]}"; do
|
for it in "${depends[@]}"; do
|
||||||
if [[ $it = *.so ]]; then
|
if [[ $it = *.so ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user