makepkg: fix find_lib{depends, provides} results

Neither function was checking for the existence of actual results before
calling printf, resulting in them returning a list with a single empty
value if there were no depends/provides.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andrew Gregory 2016-11-05 18:08:14 -04:00 committed by Allan McRae
parent 7114ca6208
commit d3dc200263

View file

@ -497,7 +497,7 @@ find_libdepends() {
done
if (( sodepends == 0 )); then
printf '%s\n' "${depends[@]}"
(( ${#depends[@]} )) && printf '%s\n' "${depends[@]}"
return;
fi
@ -546,7 +546,7 @@ find_libdepends() {
esac
done
printf '%s\n' "${libdepends[@]}"
(( ${#libdepends[@]} )) && printf '%s\n' "${libdepends[@]}"
}
@ -597,7 +597,7 @@ find_libprovides() {
fi
done
printf '%s\n' "${libprovides[@]}"
(( ${#libprovides[@]} )) && printf '%s\n' "${libprovides[@]}"
}
write_pkginfo() {