+if repo_signing_key="$(git config user.signingkey)"; then
+ : "${EXIM_KEY:=$repo_signing_key}"
+else
+ : "${EXIM_KEY:?Need a PGP key uid to sign with}"
+fi
+
+: "${GPG_COMMAND:=gpg}"
+umask 022
+
+cd_to() { echo "Working in: $1"; cd "$1"; }
+
+okay=false
+if [ -d ../../release-process ] && [ "${PWD##*/}" = "pkgs" ]; then
+ okay=true # we are in right dir
+elif [ -d release-process ]; then
+ b="$(find . -maxdepth 1 -name 'exim-packaging-*' | sort | tail -n 1)"
+ if [ ".$b" != "." ]; then
+ cd_to "$b/pkgs"
+ okay=true
+ fi
+fi
+if ! $okay; then
+ if [ -d "${1:?need a directory to look in}" ]; then
+ cd_to "$1"
+ shift
+ else
+ printf "%s: %s\n" >&2 "$(basename "$0")" "where should I be looking"
+ exit 1
+ fi
+fi