summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-07 12:38:08 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-07 12:38:08 -0400
commit60c1aeeb6fa106756c00e7bb18bbf311bd553fe1 (patch)
treed46eb17e9f156439396828370187da6ff4002161
parentbdc49ddbdb32146356fe2040d08071d7ce963466 (diff)
Fix overbroad gpg --no-tty fix from last release.
Only set --no-tty when GPG_AGENT_INFO is set and batch mode is used. In the test suite, set GPG_AGENT_INFO to /dev/null to avoid the test suite relying on /dev/tty.
-rw-r--r--Utility/Gpg.hs7
-rw-r--r--debian/changelog1
-rw-r--r--test.hs2
3 files changed, 6 insertions, 4 deletions
diff --git a/Utility/Gpg.hs b/Utility/Gpg.hs
index b50e775d0..8f7e27870 100644
--- a/Utility/Gpg.hs
+++ b/Utility/Gpg.hs
@@ -25,12 +25,11 @@ stdParams params = do
-- Enable batch mode if GPG_AGENT_INFO is set, to avoid extraneous
-- gpg output about password prompts.
e <- getEnv "GPG_AGENT_INFO"
- let batch = if isNothing e then [] else ["--batch"]
+ let batch = if isNothing e then [] else ["--batch", "--no-tty"]
return $ batch ++ defaults ++ toCommand params
where
- -- be quiet, even about checking the trustdb,
- -- and avoid using a tty
- defaults = ["--quiet", "--trust-model", "always", "--no-tty"]
+ -- be quiet, even about checking the trustdb
+ defaults = ["--quiet", "--trust-model", "always"]
{- Runs gpg with some params and returns its stdout, strictly. -}
readStrict :: [CommandParam] -> IO String
diff --git a/debian/changelog b/debian/changelog
index f9ce1e265..afca096b2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ git-annex (3.20120106) UNRELEASED; urgency=low
* Support unescaped repository urls, like git does.
* log: New command that displays the location log for files,
showing each repository they were added to and removed from.
+ * Fix overbroad gpg --no-tty fix from last release.
-- Joey Hess <joeyh@debian.org> Thu, 05 Jan 2012 14:29:30 -0400
diff --git a/test.hs b/test.hs
index 7350a0769..2ce3f8b0b 100644
--- a/test.hs
+++ b/test.hs
@@ -663,6 +663,8 @@ test_bup_remote = "git-annex bup remote" ~: intmpclonerepo $ when Build.SysConfi
-- gpg is not a build dependency, so only test when it's available
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
Utility.Gpg.testTestHarness @? "test harness self-test failed"
Utility.Gpg.testHarness $ do
createDirectory "dir"