#!/bin/bash
set -exuo pipefail

root="$PWD"

if test "${AUTOPKGTEST_TMP-}"; then
    cd "$AUTOPKGTEST_TMP"
else
    mkdir -p tmp
    cd tmp
fi

perl <"$root"/test-tag-object >plaintext -pe '
    flush && open STDOUT, ">signature.asc" or die $!
    	 if m{^-----BEGIN PGP SIGNATURE-----$};
'
rsop verify <plaintext signature.asc "$root"/debian-tag2upload.pgp

echo ok.
