1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-02-28 17:31:52 -05:00

makepkg: avoid expansion of var in arithmetic context

This bombs out when "$trusted" expands to the empty string. We're
better off passing the var by name and letting bash default to "0" when
the var is empty

Fixes: https://bugs.archlinux.org/task/43269

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Dave Reisner 2014-12-29 22:35:53 -05:00 committed by Allan McRae
parent ca5a2771ae
commit 80e6d8a6fe

View File

@ -1498,7 +1498,7 @@ check_pgpsigs() {
esac
errors=1
else
if (( ${#validpgpkeys[@]} == 0 && ! $trusted )); then
if (( ${#validpgpkeys[@]} == 0 && !trusted )); then
printf "%s ($(gettext "the public key %s is not trusted"))" $(gettext "FAILED") "$fingerprint" >&2
errors=1
elif (( ${#validpgpkeys[@]} > 0 )) && ! in_array "$fingerprint" "${validpgpkeys[@]}"; then