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.
This commit is contained in:
parent
7675b83efa
commit
9ffd97442b
2 changed files with 7 additions and 3 deletions
|
@ -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
|
||||
|
|
2
test.hs
2
test.hs
|
@ -664,7 +664,7 @@ test_bup_remote = "git-annex bup remote" ~: intmpclonerepo $ when Build.SysConfi
|
|||
test_crypto :: Test
|
||||
test_crypto = "git-annex crypto" ~: intmpclonerepo $ when Build.SysConfig.gpg $ do
|
||||
-- force gpg into batch mode for the tests
|
||||
setEnv "GPG_AGENT_INFO" "/dev/null" True
|
||||
setEnv "GPG_BATCH" "1" True
|
||||
Utility.Gpg.testTestHarness @? "test harness self-test failed"
|
||||
Utility.Gpg.testHarness $ do
|
||||
createDirectory "dir"
|
||||
|
|
Loading…
Reference in a new issue