#!/bin/sh
set -e
-for attempt in '' exec; do
-
-set +e
-$attempt \
-$DGIT_TEST_REAL_GPG \
- --agent-program=$DGIT_STUNT_AGENT \
- "$@"
-rc=$?
-set -e
-
-if [ $rc != 2 ]; then exit $rc; fi
-
-echo >&2 "WARNING - GNUPG FAILED $rc - STUNT GNUPG $attempt $*"
-
-done
-
-exit 127
+exec \
+with-lock-ex -w "$DGIT_TEST_GNUPG_GLOBAL_LOCK" \
+ $tmp "$DGIT_TEST_TROOT"/tstunt/gpg-locked "$@"