Compare commits

..

2 Commits

Author SHA1 Message Date
Levente Polyak
b8d9a2b4fd Version 20220621 2022-06-22 00:58:19 +02:00
Levente Polyak
f386c13142 export-pkgbuild-keys: fix export for packages without validpgpkeys
In case the validpgpkeys array is empty or undefined, the empty printf
line only included a single line break which lead to mapfile -t
consuming it as an array with 1 element consisting of an empty string.

Fix this by only calling the printf in case the validpgpkeys array is
not empty. Without any output, the mapfile -t will simply produce an
empty array.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2022-06-22 00:51:22 +02:00
2 changed files with 4 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
V=20220620
V=20220621
BUILDTOOLVER ?= $(V)
PREFIX = /usr/local

View File

@@ -37,7 +37,9 @@ fi
mapfile -t validpgpkeys < <(
# shellcheck source=PKGBUILD.proto
. ./PKGBUILD
printf "%s\n" "${validpgpkeys[@]}"
if (( ${#validpgpkeys[@]} )); then
printf "%s\n" "${validpgpkeys[@]}"
fi
)
msg "Exporting ${#validpgpkeys[@]} PGP keys..."