Skip to content

Commit

Permalink
commitpkg: Split signature check into own loop
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Foxboron committed Dec 25, 2021
1 parent 339d416 commit c731789
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions commitpkg.in
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,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
Expand Down

0 comments on commit c731789

Please sign in to comment.