summaryrefslogtreecommitdiff
path: root/src/Propellor/Gpg.hs
diff options
context:
space:
mode:
authorJoey Hess2016-01-03 16:57:23 -0400
committerJoey Hess2016-01-03 16:57:23 -0400
commit6a700a2a1c40332bf4961b5ea4122d4bd2bd7996 (patch)
tree8fc25d3120cef650166db4a8ccabd7504f68f290 /src/Propellor/Gpg.hs
parent3f5cc046915a9f64c31a6d48aaef5254f5eb7598 (diff)
parentfc6b042daf2a1714485373cec1c7475855799f71 (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Gpg.hs')
-rw-r--r--src/Propellor/Gpg.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Propellor/Gpg.hs b/src/Propellor/Gpg.hs
index 4c7ccc9c..d3550e88 100644
--- a/src/Propellor/Gpg.hs
+++ b/src/Propellor/Gpg.hs
@@ -13,6 +13,7 @@ import Prelude
import Propellor.PrivData.Paths
import Propellor.Message
+import Propellor.Git.Config
import Utility.SafeCommand
import Utility.Process
import Utility.Monad
@@ -21,11 +22,15 @@ import Utility.Tmp
import Utility.FileSystemEncoding
import Utility.Env
-getGpgBin :: IO String
-getGpgBin = getEnvDefault "GNUPGBIN" "gpg"
-
type KeyId = String
+getGpgBin :: IO String
+getGpgBin = do
+ gitGpgBin <- getGitConfigValue "gpg.program"
+ case gitGpgBin of
+ Nothing -> getEnvDefault "GNUPGBIN" "gpg"
+ Just b -> return b
+
keyring :: FilePath
keyring = privDataDir </> "keyring.gpg"