aboutsummaryrefslogtreecommitdiff
path: root/Utility/Gpg.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-09 18:19:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-09 18:19:29 -0400
commit9ffd97442b3f2e4e9de6895d843aee382ad10dfd (patch)
tree769a1ea960ad69355fb5711318a69162523fba8e /Utility/Gpg.hs
parent7675b83efa77527c0b04b87e35f83df67e6af8d7 (diff)
don't use GPG_AGENT_INFO to force batch mode in test suite
Fails with gpg 2. Instead, use a different environment variable. The clean fix would instead be to add an annex.gpg-options configuration. But, that would be rather a lot of work and it's unlikely it would be useful for much else.
Diffstat (limited to 'Utility/Gpg.hs')
-rw-r--r--Utility/Gpg.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Utility/Gpg.hs b/Utility/Gpg.hs
index 8f7e27870..4c798f273 100644
--- a/Utility/Gpg.hs
+++ b/Utility/Gpg.hs
@@ -23,9 +23,13 @@ newtype KeyIds = KeyIds [String]
stdParams :: [CommandParam] -> IO [String]
stdParams params = do
-- Enable batch mode if GPG_AGENT_INFO is set, to avoid extraneous
- -- gpg output about password prompts.
+ -- gpg output about password prompts. GPG_BATCH is set by the test
+ -- suite for a similar reason.
e <- getEnv "GPG_AGENT_INFO"
- let batch = if isNothing e then [] else ["--batch", "--no-tty"]
+ b <- getEnv "GPG_BATCH"
+ let batch = if isNothing e && isNothing b
+ then []
+ else ["--batch", "--no-tty"]
return $ batch ++ defaults ++ toCommand params
where
-- be quiet, even about checking the trustdb