diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2018-09-29 18:44:29 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2018-09-29 19:30:26 -0400 |
commit | 36c7b060591d5980ceaaa2c58197f0d390ecc8f5 (patch) | |
tree | 832c7c2602cb90a481b810d452a3b2be82e7b756 /test/testenv | |
parent | d32af77762e742771cb2ea9b33b2dac58563bcfb (diff) |
test: Have GPG stop dropping private keys in my home directory
Diffstat (limited to 'test/testenv')
-rwxr-xr-x | test/testenv | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/testenv b/test/testenv index faad4e1..4fc2860 100755 --- a/test/testenv +++ b/test/testenv @@ -80,6 +80,23 @@ '_sudo "$@"' \ > "$destdir/usr/bin/testsudo" chmod 755 "$destdir/usr/bin/testsudo" + # Hack to work around GnuPG being stupid with locating gpg-agent's socket + install -Dm755 /dev/stdin "$destdir/usr/bin/gpg" <<-'eot' + #!/bin/bash + export GNUPGHOME="${GNUPGHOME:-$HOME/.gnupg}" + if [[ $GNUPGHOME = "$HOME/.gnupg" ]]; then + export HOME=/var/empty + fi + exec /usr/bin/gpg "$@" + eot + install -Dm755 /dev/stdin "$destdir/usr/bin/gpg-connect-agent" <<-'eot' + #!/bin/bash + export GNUPGHOME="${GNUPGHOME:-$HOME/.gnupg}" + if [[ $GNUPGHOME = "$HOME/.gnupg" ]]; then + export HOME=/var/empty + fi + exec /usr/bin/gpg-connect-agent "$@" + eot # Run the tests command -- "$@" |