summaryrefslogtreecommitdiff
path: root/src/Propellor/Gpg.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2015-09-14 21:51:15 -0400
committerJoey Hess <joeyh@joeyh.name>2015-09-14 21:51:15 -0400
commit6957710b8d2f178efdee336131c3935aebc0b76f (patch)
tree90a57d79a0a90e000cea7161fbe0af2c4f4cc69e /src/Propellor/Gpg.hs
parent9b715f72c2eb7dec71e0392a2363474f23c1e761 (diff)
parent0d93f4f12c4c7d0a37dc2e6f792ce0f9dde793db (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Gpg.hs')
-rw-r--r--src/Propellor/Gpg.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Propellor/Gpg.hs b/src/Propellor/Gpg.hs
index 86f84dc1..24743d40 100644
--- a/src/Propellor/Gpg.hs
+++ b/src/Propellor/Gpg.hs
@@ -14,6 +14,7 @@ import Utility.Process
import Utility.Monad
import Utility.Misc
import Utility.Tmp
+import Utility.FileSystemEncoding
type KeyId = String
@@ -112,8 +113,9 @@ gpgEncrypt f s = do
, "--encrypt"
, "--trust-model", "always"
] ++ concatMap (\k -> ["--recipient", k]) keyids
- encrypted <- writeReadProcessEnv "gpg" opts
- Nothing
- (Just $ flip hPutStr s)
- Nothing
+ encrypted <- writeReadProcessEnv "gpg" opts Nothing (Just writer) Nothing
viaTmp writeFile f encrypted
+ where
+ writer h = do
+ fileEncoding h
+ hPutStr h s