5 export GNUPGHOME=$(mktemp -d)
7 arch=$(dpkg --print-architecture)
11 if ! dpkg --print-foreign-architectures | grep -Fqx i386; then
12 echo "I: setting up multiarch"
13 dpkg --add-architecture i386
14 apt update # FIXME you might want to try this up to some N times to avoid failures on temporary network issues
18 if ! dpkg --print-foreign-architectures | grep -Fqx armhf; then
19 echo "I: setting up multiarch"
20 dpkg --add-architecture armhf
21 apt update # FIXME you might want to try this up to some N times to avoid failures on temporary network issues
24 i386|armel|armhf|powerpc)
25 : nothing, tests should just work
28 echo "I: skipping tests on $arch; only works on amd64, i386, arm64, armhf, armel, and powerpc"
33 if ! dpkg-query --status wine32 | grep -Fqx 'Status: install ok installed'; then
34 DEBIAN_FRONTEND=noninteractive apt install -qy wine32 # FIXME ditto
37 echo 'no-allow-loopback-pinentry:16' | gpgconf --change-options gpg-agent
39 # Generate a minimal signing key:
40 gpg2 --batch --debug-quick-random --pinentry-mode loopback --passphrase '' --quick-gen-key 'Test key for gpgv-win32 <test-key@example.com>'
42 gpg2 -o "$GNUPGHOME/key.gpg" --export test-key@example.com
44 # Sign this very script
46 gpg2 --output "${0}.gpg" --detach-sign "${0}"
49 gpgv2 --keyring "$GNUPGHOME/key.gpg" "${0}.gpg" "${0}"
51 # Verify using gpgv.exe
52 wine /usr/share/win32/gpgv.exe --keyring "Z:\\\\${GNUPGHOME}/key.gpg" "Z:\\\\$(pwd)/${0}.gpg" "Z:\\\\$(pwd)/${0}"