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>
This commit is contained in:
parent
ec16d6e4bd
commit
95d06e0f60
28
commitpkg.in
28
commitpkg.in
|
@ -147,22 +147,24 @@ for _arch in "${arch[@]}"; do
|
|||
continue 2
|
||||
fi
|
||||
uploads+=("$pkgfile")
|
||||
|
||||
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"
|
||||
fi
|
||||
uploads+=("$sigfile")
|
||||
done
|
||||
done
|
||||
|
||||
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
|
||||
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
|
||||
if ! in_array "$_arch" "${skip_arches[@]}"; then
|
||||
commit_arches+=("$_arch")
|
||||
|
|
Loading…
Reference in New Issue