From 380afe2f2df9c4b341484571dc1b2d2d54f7400b Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Mon, 28 Aug 2017 16:51:58 +0100 Subject: [PATCH] gpg: test usability tweaks --- Library/Homebrew/gpg.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/gpg.rb b/Library/Homebrew/gpg.rb index b9a6942ecf..a63207e6c4 100644 --- a/Library/Homebrew/gpg.rb +++ b/Library/Homebrew/gpg.rb @@ -37,12 +37,21 @@ class Gpg Key-Length: 2048 Subkey-Type: RSA Subkey-Length: 2048 - Passphrase: '' Name-Real: Testing Name-Email: testing@foo.bar Expire-Date: 1d + %no-protection %commit EOS system GPG_EXECUTABLE, "--batch", "--gen-key", "batch.gpg" end + + def self.cleanup_test_processes! + odie "No GPG present to test against!" unless available? + gpgconf = Pathname.new(GPG_EXECUTABLE).parent/"gpgconf" + + system gpgconf, "--kill", "gpg-agent" + system gpgconf, "--homedir", "keyrings/live", "--kill", + "gpg-agent" + end end