diff options
author | Morten Linderud <foxboron@archlinux.org> | 2021-12-25 15:04:32 +0100 |
---|---|---|
committer | Levente Polyak <anthraxx@archlinux.org> | 2022-01-26 21:31:27 +0100 |
commit | 95d06e0f6056c3fcff87e048468318389786f0b8 (patch) | |
tree | 3cb2105611c39b1c9f7f630bc3089ac091e9c488 | |
parent | ec16d6e4bd127e5d8b930fe5428ed6fe502a045c (diff) | |
download | devtools-95d06e0f6056c3fcff87e048468318389786f0b8.tar.xz |
commitpkg: Split signature check into own loop
This allows us to extend the uploads array without having to duplicate
the current signing logic.
This doesn't change anything as we still exit on any failed packages.
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
-rw-r--r-- | commitpkg.in | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/commitpkg.in b/commitpkg.in index 465ef6b..53b7e9f 100644 --- a/commitpkg.in +++ b/commitpkg.in @@ -147,20 +147,22 @@ for _arch in "${arch[@]}"; do continue 2 fi uploads+=("$pkgfile") + done +done - sigfile="${pkgfile}.sig" - if [[ ! -f $sigfile ]]; then - msg "Signing package %s..." "${pkgfile}" - if [[ -n $GPGKEY ]]; then - SIGNWITHKEY=(-u "${GPGKEY}") - fi - gpg --detach-sign --use-agent --no-armor "${SIGNWITHKEY[@]}" "${pkgfile}" || die - fi - if ! gpg --verify "$sigfile" "$pkgfile" >/dev/null 2>&1; then - die "Signature %s is incorrect!" "$sigfile" +for pkgfile in "${uploads[@]}"; do + sigfile="${pkgfile}.sig" + if [[ ! -f $sigfile ]]; then + msg "Signing package %s..." "${pkgfile}" + if [[ -n $GPGKEY ]]; then + SIGNWITHKEY=(-u "${GPGKEY}") fi - uploads+=("$sigfile") - done + gpg --detach-sign --use-agent --no-armor "${SIGNWITHKEY[@]}" "${pkgfile}" || die + fi + if ! gpg --verify "$sigfile" "$pkgfile" >/dev/null 2>&1; then + die "Signature %s is incorrect!" "$sigfile" + fi + uploads+=("$sigfile") done for _arch in "${arch[@]}"; do |